Class: Ticketmaster::Request

Inherits:
Object
  • Object
show all
Includes:
Configuration
Defined in:
lib/ticketmaster/request.rb

Constant Summary

Constants included from Configuration

Configuration::PERMITTED_PARAMS

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clientObject

Returns the value of attribute client.



9
10
11
# File 'lib/ticketmaster/request.rb', line 9

def client
  @client
end

#methodObject

Returns the value of attribute method.



9
10
11
# File 'lib/ticketmaster/request.rb', line 9

def method
  @method
end

#paramsObject

Returns the value of attribute params.



9
10
11
# File 'lib/ticketmaster/request.rb', line 9

def params
  @params
end

#pathObject

Returns the value of attribute path.



9
10
11
# File 'lib/ticketmaster/request.rb', line 9

def path
  @path
end

Instance Method Details

#getObject



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