Class: Rafflesia::OntologySnapshotListData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/ontology/ontology_snapshot_list_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  available_count: :available_count,
  available_digests: :available_digests,
  current_digest: :current_digest,
  data: :data,
  is_remote: :is_remote,
  object: :object,
  storage_backend: :storage_backend,
  url: :url
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ OntologySnapshotListData

Returns a new instance of OntologySnapshotListData.



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rafflesia/ontology/ontology_snapshot_list_data.rb', line 29

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @available_count = hash[:available_count]
  @available_digests = (hash[:available_digests] || [])
  @current_digest = hash[:current_digest]
  @data = (hash[:data] || []).map { |item| item ? Rafflesia::OntologySnapshotSummaryData.new(item) : nil }
  @is_remote = hash[:is_remote]
  @object = hash[:object]
  @storage_backend = hash[:storage_backend]
  @url = hash[:url]
end

Instance Attribute Details

#available_countObject

Returns the value of attribute available_count.



19
20
21
# File 'lib/rafflesia/ontology/ontology_snapshot_list_data.rb', line 19

def available_count
  @available_count
end

#available_digestsObject

Returns the value of attribute available_digests.



19
20
21
# File 'lib/rafflesia/ontology/ontology_snapshot_list_data.rb', line 19

def available_digests
  @available_digests
end

#current_digestObject

Returns the value of attribute current_digest.



19
20
21
# File 'lib/rafflesia/ontology/ontology_snapshot_list_data.rb', line 19

def current_digest
  @current_digest
end

#dataObject

Returns the value of attribute data.



19
20
21
# File 'lib/rafflesia/ontology/ontology_snapshot_list_data.rb', line 19

def data
  @data
end

#is_remoteObject

Returns the value of attribute is_remote.



19
20
21
# File 'lib/rafflesia/ontology/ontology_snapshot_list_data.rb', line 19

def is_remote
  @is_remote
end

#objectObject

Returns the value of attribute object.



19
20
21
# File 'lib/rafflesia/ontology/ontology_snapshot_list_data.rb', line 19

def object
  @object
end

#storage_backendObject

Returns the value of attribute storage_backend.



19
20
21
# File 'lib/rafflesia/ontology/ontology_snapshot_list_data.rb', line 19

def storage_backend
  @storage_backend
end

#urlObject

Returns the value of attribute url.



19
20
21
# File 'lib/rafflesia/ontology/ontology_snapshot_list_data.rb', line 19

def url
  @url
end