Class: Rafflesia::Snapshot
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::Snapshot
- Defined in:
- lib/rafflesia/registry/snapshot.rb
Constant Summary collapse
- HASH_ATTRS =
{ access_policy: :access_policy, dandelion_bindings: :dandelion_bindings, dataset_bindings: :dataset_bindings, foundry_bindings: :foundry_bindings, ontology_modules: :ontology_modules, organization: :organization, repositories: :repositories, resource_group: :resource_group, schema_version: :schema_version }.freeze
Instance Attribute Summary collapse
-
#access_policy ⇒ Object
Returns the value of attribute access_policy.
-
#dandelion_bindings ⇒ Object
Returns the value of attribute dandelion_bindings.
-
#dataset_bindings ⇒ Object
Returns the value of attribute dataset_bindings.
-
#foundry_bindings ⇒ Object
Returns the value of attribute foundry_bindings.
-
#ontology_modules ⇒ Object
Returns the value of attribute ontology_modules.
-
#organization ⇒ Object
Returns the value of attribute organization.
-
#repositories ⇒ Object
Returns the value of attribute repositories.
-
#resource_group ⇒ Object
Returns the value of attribute resource_group.
-
#schema_version ⇒ Object
Returns the value of attribute schema_version.
Instance Method Summary collapse
-
#initialize(json) ⇒ Snapshot
constructor
A new instance of Snapshot.
Constructor Details
#initialize(json) ⇒ Snapshot
Returns a new instance of Snapshot.
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/rafflesia/registry/snapshot.rb', line 31 def initialize(json) super() hash = self.class.normalize(json) @access_policy = hash[:access_policy] ? Rafflesia::AccessPolicy.new(hash[:access_policy]) : nil @dandelion_bindings = (hash[:dandelion_bindings] || []).map { |item| item ? Rafflesia::DandelionBinding.new(item) : nil } @dataset_bindings = (hash[:dataset_bindings] || []).map { |item| item ? Rafflesia::DatasetOntologyBinding.new(item) : nil } @foundry_bindings = (hash[:foundry_bindings] || []).map { |item| item ? Rafflesia::FoundryBinding.new(item) : nil } @ontology_modules = (hash[:ontology_modules] || []).map { |item| item ? Rafflesia::OntologyModuleRelease.new(item) : nil } @organization = hash[:organization] ? Rafflesia::Organization.new(hash[:organization]) : nil @repositories = (hash[:repositories] || []).map { |item| item ? Rafflesia::RepositoryData.new(item) : nil } @resource_group = hash[:resource_group] ? Rafflesia::ResourceGroup.new(hash[:resource_group]) : nil @schema_version = hash[:schema_version] end |
Instance Attribute Details
#access_policy ⇒ Object
Returns the value of attribute access_policy.
20 21 22 |
# File 'lib/rafflesia/registry/snapshot.rb', line 20 def access_policy @access_policy end |
#dandelion_bindings ⇒ Object
Returns the value of attribute dandelion_bindings.
20 21 22 |
# File 'lib/rafflesia/registry/snapshot.rb', line 20 def dandelion_bindings @dandelion_bindings end |
#dataset_bindings ⇒ Object
Returns the value of attribute dataset_bindings.
20 21 22 |
# File 'lib/rafflesia/registry/snapshot.rb', line 20 def dataset_bindings @dataset_bindings end |
#foundry_bindings ⇒ Object
Returns the value of attribute foundry_bindings.
20 21 22 |
# File 'lib/rafflesia/registry/snapshot.rb', line 20 def foundry_bindings @foundry_bindings end |
#ontology_modules ⇒ Object
Returns the value of attribute ontology_modules.
20 21 22 |
# File 'lib/rafflesia/registry/snapshot.rb', line 20 def ontology_modules @ontology_modules end |
#organization ⇒ Object
Returns the value of attribute organization.
20 21 22 |
# File 'lib/rafflesia/registry/snapshot.rb', line 20 def organization @organization end |
#repositories ⇒ Object
Returns the value of attribute repositories.
20 21 22 |
# File 'lib/rafflesia/registry/snapshot.rb', line 20 def repositories @repositories end |
#resource_group ⇒ Object
Returns the value of attribute resource_group.
20 21 22 |
# File 'lib/rafflesia/registry/snapshot.rb', line 20 def resource_group @resource_group end |
#schema_version ⇒ Object
Returns the value of attribute schema_version.
20 21 22 |
# File 'lib/rafflesia/registry/snapshot.rb', line 20 def schema_version @schema_version end |