Class: NovaposhtaApi::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/novaposhta_api/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http: nil) ⇒ Resource

Returns a new instance of Resource.



7
8
9
# File 'lib/novaposhta_api/resource.rb', line 7

def initialize(http: nil)
  @http = http
end

Instance Attribute Details

#httpObject (readonly)

Returns the value of attribute http.



5
6
7
# File 'lib/novaposhta_api/resource.rb', line 5

def http
  @http
end

Instance Method Details

#request(*args) ⇒ Object



11
12
13
14
# File 'lib/novaposhta_api/resource.rb', line 11

def request(*args)
  response = http.request(:post, *args)
  response['data']
end