Class: Fastbill::Automatic::Request::Info

Inherits:
Object
  • Object
show all
Defined in:
lib/fastbill-automatic/request/info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject

Returns the value of attribute data.



5
6
7
# File 'lib/fastbill-automatic/request/info.rb', line 5

def data
  @data
end

#serviceObject

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

#urlObject



16
17
18
19
# File 'lib/fastbill-automatic/request/info.rb', line 16

def url
  url = "/api/#{API_VERSION}/api.php"
  url
end