Class: Moo::Model::FixedImageData

Inherits:
Data show all
Defined in:
lib/moo/model/fixed_image_data.rb

Instance Attribute Summary collapse

Attributes inherited from Data

#link_id

Instance Method Summary collapse

Methods inherited from Data

#type

Constructor Details

#initialize {|_self| ... } ⇒ FixedImageData

Returns a new instance of FixedImageData.

Yields:

  • (_self)

Yield Parameters:



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_uriObject

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_hashObject



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_jsonObject



17
18
19
# File 'lib/moo/model/fixed_image_data.rb', line 17

def to_json
  to_hash.to_json
end