Class: Ticketmaster::Request
- Inherits:
-
Object
- Object
- Ticketmaster::Request
- Includes:
- Configuration
- Defined in:
- lib/ticketmaster/request.rb
Constant Summary
Constants included from Configuration
Configuration::PERMITTED_PARAMS
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#method ⇒ Object
Returns the value of attribute method.
-
#params ⇒ Object
Returns the value of attribute params.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(path, params, client) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(path, params, client) ⇒ Request
Returns a new instance of Request.
11 12 13 14 15 |
# File 'lib/ticketmaster/request.rb', line 11 def initialize(path, params, client) self.path = path self.params = params self.client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
9 10 11 |
# File 'lib/ticketmaster/request.rb', line 9 def client @client end |
#method ⇒ Object
Returns the value of attribute method.
9 10 11 |
# File 'lib/ticketmaster/request.rb', line 9 def method @method end |
#params ⇒ Object
Returns the value of attribute params.
9 10 11 |
# File 'lib/ticketmaster/request.rb', line 9 def params @params end |
#path ⇒ Object
Returns the value of attribute path.
9 10 11 |
# File 'lib/ticketmaster/request.rb', line 9 def path @path end |
Instance Method Details
#get ⇒ Object
17 18 19 20 21 |
# File 'lib/ticketmaster/request.rb', line 17 def get conn = Faraday.new(:url => 'https://app.ticketmaster.com') response = conn.get path, formatted_params JSON.parse(response.body) end |