Class: Chartmogul::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/chartmogul/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(end_point, http_method, headers: {}, **attributes) ⇒ Client

Returns a new instance of Client


9
10
11
12
13
14
# File 'lib/chartmogul/client.rb', line 9

def initialize(end_point, http_method, headers: {}, **attributes)
  @end_point = end_point
  @http_method = http_method
  @headers = headers
  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes


7
8
9
# File 'lib/chartmogul/client.rb', line 7

def attributes
  @attributes
end

#end_pointObject (readonly)

Returns the value of attribute end_point


7
8
9
# File 'lib/chartmogul/client.rb', line 7

def end_point
  @end_point
end

#headersObject (readonly)

Returns the value of attribute headers


7
8
9
# File 'lib/chartmogul/client.rb', line 7

def headers
  @headers
end

#http_methodObject (readonly)

Returns the value of attribute http_method


7
8
9
# File 'lib/chartmogul/client.rb', line 7

def http_method
  @http_method
end

Instance Method Details

#executeObject


16
17
18
# File 'lib/chartmogul/client.rb', line 16

def execute
  Chartmogul::Response.parse_json(execute_request)
end