Class: Rafflesia::AnnotationMapData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/annotations/annotation_map_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  from_id: :from_id,
  mappings: :mappings,
  to_ref: :to_ref
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ AnnotationMapData

Returns a new instance of AnnotationMapData.



19
20
21
22
23
24
25
# File 'lib/rafflesia/annotations/annotation_map_data.rb', line 19

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @from_id = hash[:from_id]
  @mappings = (hash[:mappings] || []).map { |item| item ? Rafflesia::AnnotationMapping.new(item) : nil }
  @to_ref = hash[:to_ref]
end

Instance Attribute Details

#from_idObject

Returns the value of attribute from_id.



14
15
16
# File 'lib/rafflesia/annotations/annotation_map_data.rb', line 14

def from_id
  @from_id
end

#mappingsObject

Returns the value of attribute mappings.



14
15
16
# File 'lib/rafflesia/annotations/annotation_map_data.rb', line 14

def mappings
  @mappings
end

#to_refObject

Returns the value of attribute to_ref.



14
15
16
# File 'lib/rafflesia/annotations/annotation_map_data.rb', line 14

def to_ref
  @to_ref
end