Class: NovaposhtaApi::Model
- Inherits:
-
Hashie::Trash
- Object
- Hashie::Trash
- NovaposhtaApi::Model
- Includes:
- Hashie::Extensions::Coercion, Hashie::Extensions::IgnoreUndeclared, Hashie::Extensions::IndifferentAccess
- Defined in:
- lib/novaposhta_api/model.rb
Direct Known Subclasses
NovaposhtaApi::Models::City, NovaposhtaApi::Models::ContactPerson, NovaposhtaApi::Models::Counterparty, NovaposhtaApi::Models::CounterpartyAddress, NovaposhtaApi::Models::InternetDocument, NovaposhtaApi::Models::Settlement, NovaposhtaApi::Models::TrackingDocument, NovaposhtaApi::Models::Warehouse
Class Method Summary collapse
Class Method Details
.extract_collection(data) ⇒ Object
10 11 12 |
# File 'lib/novaposhta_api/model.rb', line 10 def extract_collection(data) NovaposhtaApi::Collection.new(data, self) end |
.extract_single(data) ⇒ Object
14 15 16 17 18 |
# File 'lib/novaposhta_api/model.rb', line 14 def extract_single(data) item = data.is_a?(Array) ? data.first : data new(item) end |