Class: DiscountNetwork::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_method, end_point, attributes = {}) ⇒ Client

Returns a new instance of Client.



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

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

#end_pointObject (readonly)

Returns the value of attribute end_point.



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

def end_point
  @end_point
end

#http_methodObject (readonly)

Returns the value of attribute http_method.



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

def http_method
  @http_method
end

Instance Method Details

#executeObject



15
16
17
# File 'lib/discountnetwork/client.rb', line 15

def execute
  Response.new(execute_api_request).parse
end