Class: Teilashare::Request

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, resource) ⇒ Request

Returns a new instance of Request.



7
8
9
10
# File 'lib/teilashare/request.rb', line 7

def initialize(client, resource)
  @client = client
  @resource = resource
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/teilashare/request.rb', line 5

def client
  @client
end

#resourceObject (readonly)

Returns the value of attribute resource.



5
6
7
# File 'lib/teilashare/request.rb', line 5

def resource
  @resource
end

Instance Method Details

#callObject



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

def call
  connection.get(request_url) do |req|
    req.headers['x-ShareASale-Date'] = auth.date_string
    req.headers['x-ShareASale-Authentication'] = auth.hash
  end
end