Class: Millennium::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/millennium/request.rb

Overview

lib/millennium/request.rb

Instance Method Summary collapse

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

#runObject



11
12
13
14
15
16
17
# File 'lib/millennium/request.rb', line 11

def run
  options = Millennium::Config.options
  format = {}
  format['$format'] = 'json'
  params = @params.merge(format)
  Typhoeus::Request.new(url, options.merge(params: params)).run
end