Class: Rafflesia::AnnotationMapping
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::AnnotationMapping
- Defined in:
- lib/rafflesia/annotations/annotation_mapping.rb
Constant Summary collapse
- HASH_ATTRS =
{ annotation: :annotation, is_positionally_mapped: :is_positionally_mapped, to_ref: :to_ref, warnings: :warnings }.freeze
Instance Attribute Summary collapse
-
#annotation ⇒ Object
Returns the value of attribute annotation.
-
#is_positionally_mapped ⇒ Object
Returns the value of attribute is_positionally_mapped.
-
#to_ref ⇒ Object
Returns the value of attribute to_ref.
-
#warnings ⇒ Object
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize(json) ⇒ AnnotationMapping
constructor
A new instance of AnnotationMapping.
Constructor Details
#initialize(json) ⇒ AnnotationMapping
Returns a new instance of AnnotationMapping.
21 22 23 24 25 26 27 28 |
# File 'lib/rafflesia/annotations/annotation_mapping.rb', line 21 def initialize(json) super() hash = self.class.normalize(json) @annotation = hash[:annotation] ? Rafflesia::AnnotationRecord.new(hash[:annotation]) : nil @is_positionally_mapped = hash[:is_positionally_mapped] @to_ref = hash[:to_ref] @warnings = (hash[:warnings] || []).map { |item| item ? Rafflesia::SearchWarning.new(item) : nil } end |
Instance Attribute Details
#annotation ⇒ Object
Returns the value of attribute annotation.
15 16 17 |
# File 'lib/rafflesia/annotations/annotation_mapping.rb', line 15 def annotation @annotation end |
#is_positionally_mapped ⇒ Object
Returns the value of attribute is_positionally_mapped.
15 16 17 |
# File 'lib/rafflesia/annotations/annotation_mapping.rb', line 15 def is_positionally_mapped @is_positionally_mapped end |
#to_ref ⇒ Object
Returns the value of attribute to_ref.
15 16 17 |
# File 'lib/rafflesia/annotations/annotation_mapping.rb', line 15 def to_ref @to_ref end |
#warnings ⇒ Object
Returns the value of attribute warnings.
15 16 17 |
# File 'lib/rafflesia/annotations/annotation_mapping.rb', line 15 def warnings @warnings end |