Class: Rafflesia::AnnotationRecord
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::AnnotationRecord
- Defined in:
- lib/rafflesia/annotations/annotation_record.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, labels: :labels, raw_object: :raw_object, source: :source, xrefs: :xrefs }.freeze
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#raw_object ⇒ Object
Returns the value of attribute raw_object.
-
#source ⇒ Object
Returns the value of attribute source.
-
#xrefs ⇒ Object
Returns the value of attribute xrefs.
Instance Method Summary collapse
-
#initialize(json) ⇒ AnnotationRecord
constructor
A new instance of AnnotationRecord.
Constructor Details
#initialize(json) ⇒ AnnotationRecord
Returns a new instance of AnnotationRecord.
23 24 25 26 27 28 29 30 31 |
# File 'lib/rafflesia/annotations/annotation_record.rb', line 23 def initialize(json) super() hash = self.class.normalize(json) @id = hash[:id] @labels = (hash[:labels] || []) @raw_object = hash[:raw_object] ? Rafflesia::ObjectRef.new(hash[:raw_object]) : nil @source = hash[:source] @xrefs = hash[:xrefs] || {} end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
16 17 18 |
# File 'lib/rafflesia/annotations/annotation_record.rb', line 16 def id @id end |
#labels ⇒ Object
Returns the value of attribute labels.
16 17 18 |
# File 'lib/rafflesia/annotations/annotation_record.rb', line 16 def labels @labels end |
#raw_object ⇒ Object
Returns the value of attribute raw_object.
16 17 18 |
# File 'lib/rafflesia/annotations/annotation_record.rb', line 16 def raw_object @raw_object end |
#source ⇒ Object
Returns the value of attribute source.
16 17 18 |
# File 'lib/rafflesia/annotations/annotation_record.rb', line 16 def source @source end |
#xrefs ⇒ Object
Returns the value of attribute xrefs.
16 17 18 |
# File 'lib/rafflesia/annotations/annotation_record.rb', line 16 def xrefs @xrefs end |