Class: Rafflesia::AnnotationRecord

Inherits:
Types::BaseModel
  • Object
show all
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

Instance Method Summary collapse

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

#idObject

Returns the value of attribute id.



16
17
18
# File 'lib/rafflesia/annotations/annotation_record.rb', line 16

def id
  @id
end

#labelsObject

Returns the value of attribute labels.



16
17
18
# File 'lib/rafflesia/annotations/annotation_record.rb', line 16

def labels
  @labels
end

#raw_objectObject

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

#sourceObject

Returns the value of attribute source.



16
17
18
# File 'lib/rafflesia/annotations/annotation_record.rb', line 16

def source
  @source
end

#xrefsObject

Returns the value of attribute xrefs.



16
17
18
# File 'lib/rafflesia/annotations/annotation_record.rb', line 16

def xrefs
  @xrefs
end