Class: NovaposhtaApi::Resource
- Inherits:
-
Object
- Object
- NovaposhtaApi::Resource
- Defined in:
- lib/novaposhta_api/resource.rb
Direct Known Subclasses
NovaposhtaApi::Resources::CityResource, NovaposhtaApi::Resources::CounterpartyResource, NovaposhtaApi::Resources::InternetDocumentResource, NovaposhtaApi::Resources::SettlementResource, NovaposhtaApi::Resources::TrackingDocumentResource, NovaposhtaApi::Resources::WarehouseResource
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
Returns the value of attribute http.
Instance Method Summary collapse
-
#initialize(http: nil) ⇒ Resource
constructor
A new instance of Resource.
- #request(*args) ⇒ Object
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
#http ⇒ Object (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 |