Class: Api2Convert::Model::Conversion
- Inherits:
-
Object
- Object
- Api2Convert::Model::Conversion
- Defined in:
- lib/api2convert/model/conversion.rb
Overview
A single conversion within a job: the target format plus its options.
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(target: "", id: nil, category: nil, options: {}, metadata: {}) ⇒ Conversion
constructor
A new instance of Conversion.
Constructor Details
#initialize(target: "", id: nil, category: nil, options: {}, metadata: {}) ⇒ Conversion
Returns a new instance of Conversion.
9 10 11 12 13 14 15 16 |
# File 'lib/api2convert/model/conversion.rb', line 9 def initialize(target: "", id: nil, category: nil, options: {}, metadata: {}) @target = target @id = id @category = category @options = @metadata = freeze end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
7 8 9 |
# File 'lib/api2convert/model/conversion.rb', line 7 def category @category end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/api2convert/model/conversion.rb', line 7 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/api2convert/model/conversion.rb', line 7 def @metadata end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/api2convert/model/conversion.rb', line 7 def @options end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
7 8 9 |
# File 'lib/api2convert/model/conversion.rb', line 7 def target @target end |
Class Method Details
.from_hash(data) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/api2convert/model/conversion.rb', line 18 def self.from_hash(data) d = Support::Data.as_object(data) new( target: Support::Data.as_str(d["target"]), id: Support::Data.nullable_str(d["id"]), category: Support::Data.nullable_str(d["category"]), options: Support::Data.as_object(d["options"]), metadata: Support::Data.as_object(d["metadata"]) ) end |