Class: Vidalo::Connection
- Inherits:
-
Object
- Object
- Vidalo::Connection
- Includes:
- API::Get, API::Search, Parser
- Defined in:
- lib/vidalo/connection.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#app_key ⇒ Object
readonly
Returns the value of attribute app_key.
Instance Method Summary collapse
-
#initialize(app_id, app_key) ⇒ Connection
constructor
A new instance of Connection.
Methods included from Parser
#get_inner_text, #get_node_value
Methods included from API::Search
Methods included from API::Get
#get_number_of_products, #send_api_request
Constructor Details
#initialize(app_id, app_key) ⇒ Connection
Returns a new instance of Connection.
13 14 15 16 17 18 19 20 21 |
# File 'lib/vidalo/connection.rb', line 13 def initialize(app_id, app_key) @app_id = app_id @app_key = app_key @conn = Faraday.new(url: VIDAL_API_URL, request: { params_encoder: Faraday::FlatParamsEncoder }, params: { app_id: app_id, app_key: app_key }) do |faraday| faraday.adapter Faraday.default_adapter end end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
11 12 13 |
# File 'lib/vidalo/connection.rb', line 11 def app_id @app_id end |
#app_key ⇒ Object (readonly)
Returns the value of attribute app_key.
11 12 13 |
# File 'lib/vidalo/connection.rb', line 11 def app_key @app_key end |