Class: Paymill::Request::Info
- Inherits:
-
Object
- Object
- Paymill::Request::Info
- Defined in:
- lib/paymill/request/info.rb
Instance Attribute Summary collapse
-
#api_url ⇒ Object
Returns the value of attribute api_url.
-
#data ⇒ Object
Returns the value of attribute data.
-
#http_method ⇒ Object
Returns the value of attribute http_method.
Instance Method Summary collapse
-
#initialize(http_method, api_url, data) ⇒ Info
constructor
A new instance of Info.
- #path_with_params(path, params) ⇒ Object
- #url ⇒ Object
Constructor Details
permalink #initialize(http_method, api_url, data) ⇒ Info
Returns a new instance of Info.
6 7 8 9 10 |
# File 'lib/paymill/request/info.rb', line 6 def initialize(http_method, api_url, data) @http_method = http_method @api_url = api_url @data = data end |
Instance Attribute Details
permalink #api_url ⇒ Object
Returns the value of attribute api_url.
4 5 6 |
# File 'lib/paymill/request/info.rb', line 4 def api_url @api_url end |
permalink #data ⇒ Object
Returns the value of attribute data.
4 5 6 |
# File 'lib/paymill/request/info.rb', line 4 def data @data end |
permalink #http_method ⇒ Object
Returns the value of attribute http_method.
4 5 6 |
# File 'lib/paymill/request/info.rb', line 4 def http_method @http_method end |
Instance Method Details
permalink #path_with_params(path, params) ⇒ Object
[View source]
22 23 24 25 26 27 28 29 |
# File 'lib/paymill/request/info.rb', line 22 def path_with_params(path, params) unless params.empty? encoded_params = URI.encode_www_form(params) [path, encoded_params].join("?") else path end end |
permalink #url ⇒ Object
[View source]
12 13 14 15 16 17 18 19 20 |
# File 'lib/paymill/request/info.rb', line 12 def url url = "/#{Paymill.api_version}/#{api_url}" if is_refund? url += "/#{data[:id]}" data.delete(:id) end url end |