Class: Viki::Client
Constant Summary
Constants included from Utilities
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
Instance Method Summary collapse
-
#initialize(client_id, client_secret) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(client_id, client_secret) ⇒ Client
Returns a new instance of Client.
11 12 13 14 15 |
# File 'lib/viki/client.rb', line 11 def initialize(client_id, client_secret) @client_id = client_id @client_secret = client_secret @access_token = auth_request(client_id, client_secret) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object (private)
20 21 22 23 24 25 |
# File 'lib/viki/client.rb', line 20 def method_missing(name, *args) raise NoMethodError if not URL_NAMESPACES.include? name Viki::Request.new({client_id: @client_id, client_secret: @client_secret, access_token: @access_token}, name, *args) end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
17 18 19 |
# File 'lib/viki/client.rb', line 17 def access_token @access_token end |