Class: Locaweb::Gateway::Request
- Inherits:
-
Object
- Object
- Locaweb::Gateway::Request
- Defined in:
- lib/locaweb-gateway/request.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
Instance Method Summary collapse
- #get(params) ⇒ Object
-
#initialize(options = {}) ⇒ Request
constructor
A new instance of Request.
- #post(params) ⇒ Object
- #request_uri ⇒ Object
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(={}) @action = [:action] @engine = RestClient end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
4 5 6 |
# File 'lib/locaweb-gateway/request.rb', line 4 def action @action end |
#engine ⇒ Object (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_uri ⇒ Object
12 13 14 |
# File 'lib/locaweb-gateway/request.rb', line 12 def request_uri "#{base_uri}#{action}" end |