Class: Fastbill::Automatic::Request::Info
- Inherits:
-
Object
- Object
- Fastbill::Automatic::Request::Info
- Defined in:
- lib/fastbill-automatic/request/info.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#service ⇒ Object
Returns the value of attribute service.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(service, data) ⇒ Info
constructor
A new instance of Info.
- #path_with_params(path, params) ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(service, data) ⇒ Info
Returns a new instance of Info.
11 12 13 14 |
# File 'lib/fastbill-automatic/request/info.rb', line 11 def initialize(service, data) @service = service @data = data end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/fastbill-automatic/request/info.rb', line 5 def data @data end |
#service ⇒ Object
Returns the value of attribute service.
5 6 7 |
# File 'lib/fastbill-automatic/request/info.rb', line 5 def service @service end |
Instance Method Details
#==(other) ⇒ Object
7 8 9 |
# File 'lib/fastbill-automatic/request/info.rb', line 7 def ==(other) @service == other.service && @data == other.data end |
#path_with_params(path, params) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/fastbill-automatic/request/info.rb', line 21 def path_with_params(path, params) unless params.empty? encoded_params = URI.encode_www_form(params) [path, encoded_params].join("?") else path end end |
#url ⇒ Object
16 17 18 19 |
# File 'lib/fastbill-automatic/request/info.rb', line 16 def url url = "/api/#{API_VERSION}/api.php" url end |