Class: Millennium::Request
- Inherits:
-
Object
- Object
- Millennium::Request
- Defined in:
- lib/millennium/request.rb
Overview
lib/millennium/request.rb
Instance Method Summary collapse
-
#initialize(object, endpoint, params) ⇒ Request
constructor
A new instance of Request.
- #run ⇒ Object
Constructor Details
#initialize(object, endpoint, params) ⇒ Request
Returns a new instance of Request.
5 6 7 8 9 |
# File 'lib/millennium/request.rb', line 5 def initialize(object, endpoint, params) @object = object @endpoint = endpoint @params = params end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/millennium/request.rb', line 11 def run = Millennium::Config. format = {} format['$format'] = 'json' params = @params.merge(format) Typhoeus::Request.new(url, .merge(params: params)).run end |