Class: ABBYY::Cloud::Struct
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- ABBYY::Cloud::Struct
- Defined in:
- lib/abbyy/cloud/struct.rb
Direct Known Subclasses
Models::Direction, Models::Discount, Models::Engine, Models::Error, Models::FileReference, Models::FullOrder, Models::OcrSettings, Models::OcrStatistics, Models::OcrWarning, Models::OrderStatistics, Models::Price, Models::SourceSegment, Models::SourceTag, Models::TextStatistics, Models::TransferData, Models::Translation, Models::TranslationLink, Models::TranslationSegment, Models::UnitPrice
Class Method Summary collapse
- .new(data) ⇒ Object (also: [])
Class Method Details
.new(data) ⇒ Object Also known as: []
3 4 5 6 7 8 9 10 |
# File 'lib/abbyy/cloud/struct.rb', line 3 def new(data) default = schema.keys.each_with_object({}) { |key, hash| hash[key] = nil } actual = data.to_hash.each_with_object({}) do |(key, val), hash| hash[key.to_sym] = val end super default.merge(actual) end |