Class: Yoolinkpro::Client
- Inherits:
-
Object
- Object
- Yoolinkpro::Client
- Defined in:
- lib/yoolinkpro/client.rb
Instance Attribute Summary collapse
-
#admin_key ⇒ Object
readonly
Returns the value of attribute admin_key.
-
#private_key ⇒ Object
readonly
Returns the value of attribute private_key.
-
#public_key ⇒ Object
readonly
Returns the value of attribute public_key.
Instance Method Summary collapse
-
#initialize(public_key = Yoolinkpro.public_key, private_key = Yoolinkpro.private_key, admin_key = Yoolinkpro.admin_key) ⇒ Yoolinkpro::Client
constructor
Yoolinkpro::Client.
- #method_missing(method, *args) ⇒ Object
Constructor Details
#initialize(public_key = Yoolinkpro.public_key, private_key = Yoolinkpro.private_key, admin_key = Yoolinkpro.admin_key) ⇒ Yoolinkpro::Client
Yoolinkpro::Client
client = Yoolinkpro::Client.new 'public_key', 'private_key', 'admin_key'
14 15 16 |
# File 'lib/yoolinkpro/client.rb', line 14 def initialize(public_key = Yoolinkpro.public_key, private_key = Yoolinkpro.private_key, admin_key = Yoolinkpro.admin_key) @public_key, @private_key, @admin_key = public_key, private_key, admin_key end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/yoolinkpro/client.rb', line 18 def method_missing(method, *args) api = Api.new(self) response = api.send(method, *args) Oj.load(response.body, :symbol_keys => true) rescue RestClient::Exception => ex raise ApiException, ex. end |
Instance Attribute Details
#admin_key ⇒ Object (readonly)
Returns the value of attribute admin_key.
4 5 6 |
# File 'lib/yoolinkpro/client.rb', line 4 def admin_key @admin_key end |
#private_key ⇒ Object (readonly)
Returns the value of attribute private_key.
4 5 6 |
# File 'lib/yoolinkpro/client.rb', line 4 def private_key @private_key end |
#public_key ⇒ Object (readonly)
Returns the value of attribute public_key.
4 5 6 |
# File 'lib/yoolinkpro/client.rb', line 4 def public_key @public_key end |