Class: Locaweb::Gateway::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/locaweb-gateway/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Request

Returns a new instance of Request.



7
8
9
10
# File 'lib/locaweb-gateway/request.rb', line 7

def initialize(options={})
  @action = options[:action]
  @engine = RestClient
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



4
5
6
# File 'lib/locaweb-gateway/request.rb', line 4

def action
  @action
end

#engineObject (readonly)

Returns the value of attribute engine.



4
5
6
# File 'lib/locaweb-gateway/request.rb', line 4

def engine
  @engine
end

Instance Method Details

#get(params) ⇒ Object



20
21
22
# File 'lib/locaweb-gateway/request.rb', line 20

def get(params)
  http_request(:method => :get, :params => { :params => params })
end

#post(params) ⇒ Object



16
17
18
# File 'lib/locaweb-gateway/request.rb', line 16

def post(params)
  http_request(:method => :post, :params => params.to_json)
end

#request_uriObject



12
13
14
# File 'lib/locaweb-gateway/request.rb', line 12

def request_uri
  "#{base_uri}#{action}"
end