Class: Moo::Model::FixedImageData
- Defined in:
- lib/moo/model/fixed_image_data.rb
Instance Attribute Summary collapse
-
#resource_uri ⇒ Object
Returns the value of attribute resource_uri.
Attributes inherited from Data
Instance Method Summary collapse
- #from_hash(hash) ⇒ Object
- #from_json(json) ⇒ Object
-
#initialize {|_self| ... } ⇒ FixedImageData
constructor
A new instance of FixedImageData.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Data
Constructor Details
#initialize {|_self| ... } ⇒ FixedImageData
Returns a new instance of FixedImageData.
6 7 8 |
# File 'lib/moo/model/fixed_image_data.rb', line 6 def initialize yield self if block_given? end |
Instance Attribute Details
#resource_uri ⇒ Object
Returns the value of attribute resource_uri.
4 5 6 |
# File 'lib/moo/model/fixed_image_data.rb', line 4 def resource_uri @resource_uri end |
Instance Method Details
#from_hash(hash) ⇒ Object
34 35 36 37 |
# File 'lib/moo/model/fixed_image_data.rb', line 34 def from_hash hash self.link_id = hash[:linkId] self.resource_uri = hash[:resourceUri] end |
#from_json(json) ⇒ Object
30 31 32 |
# File 'lib/moo/model/fixed_image_data.rb', line 30 def from_json json from_hash(JSON.parse(json, :symbolize_names => true)) end |
#to_hash ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/moo/model/fixed_image_data.rb', line 21 def to_hash hash = { type: type, linkId: link_id } hash[:resourceUri] = resource_uri unless resource_uri.nil? hash end |
#to_json ⇒ Object
17 18 19 |
# File 'lib/moo/model/fixed_image_data.rb', line 17 def to_json to_hash.to_json end |