Class: Rafflesia::AnnotationFetchData

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

Constant Summary collapse

HASH_ATTRS =
{
  records: :records
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ AnnotationFetchData

Returns a new instance of AnnotationFetchData.



14
15
16
17
18
# File 'lib/rafflesia/annotations/annotation_fetch_data.rb', line 14

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

Instance Attribute Details

#recordsObject

Returns the value of attribute records.



12
13
14
# File 'lib/rafflesia/annotations/annotation_fetch_data.rb', line 12

def records
  @records
end