Class: Rafflesia::AnnotationMapData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::AnnotationMapData
- 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
-
#from_id ⇒ Object
Returns the value of attribute from_id.
-
#mappings ⇒ Object
Returns the value of attribute mappings.
-
#to_ref ⇒ Object
Returns the value of attribute to_ref.
Instance Method Summary collapse
-
#initialize(json) ⇒ AnnotationMapData
constructor
A new instance of AnnotationMapData.
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_id ⇒ Object
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 |
#mappings ⇒ Object
Returns the value of attribute mappings.
14 15 16 |
# File 'lib/rafflesia/annotations/annotation_map_data.rb', line 14 def mappings @mappings end |
#to_ref ⇒ Object
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 |