Class: YaMetrika::Client
- Inherits:
-
Object
- Object
- YaMetrika::Client
- Defined in:
- lib/ya_metrika/client.rb
Constant Summary collapse
- HOST =
'http://api-metrika.yandex.ru'
- REST_METHODS =
[:get, :post, :put, :delete]
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #method_missing(meth, *args, &block) ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/ya_metrika/client.rb', line 17 def method_missing(meth, *args, &block) if YaMetrika::Client::REST_METHODS.include?(meth.to_sym) rest(meth, *args, &block) else @spells << meth.to_s @spells << args.first.to_s if args.first self end end |