Class: Rafflesia::StructureData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::StructureData
- Defined in:
- lib/rafflesia/artifacts/structure_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ format: :format, metadata: :metadata, model_version: :model_version, object: :object, pae_object: :pae_object, source: :source, source_url: :source_url, structure_id: :structure_id, target_id: :target_id }.freeze
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#model_version ⇒ Object
Returns the value of attribute model_version.
-
#object ⇒ Object
Returns the value of attribute object.
-
#pae_object ⇒ Object
Returns the value of attribute pae_object.
-
#source ⇒ Object
Returns the value of attribute source.
-
#source_url ⇒ Object
Returns the value of attribute source_url.
-
#structure_id ⇒ Object
Returns the value of attribute structure_id.
-
#target_id ⇒ Object
Returns the value of attribute target_id.
Instance Method Summary collapse
-
#initialize(json) ⇒ StructureData
constructor
A new instance of StructureData.
Constructor Details
#initialize(json) ⇒ StructureData
Returns a new instance of StructureData.
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/rafflesia/artifacts/structure_data.rb', line 31 def initialize(json) super() hash = self.class.normalize(json) @format = hash[:format] @metadata = hash[:metadata] || {} @model_version = hash[:model_version] @object = hash[:object] ? Rafflesia::ObjectRef.new(hash[:object]) : nil @pae_object = hash[:pae_object] ? Rafflesia::ObjectRef.new(hash[:pae_object]) : nil @source = hash[:source] @source_url = hash[:source_url] @structure_id = hash[:structure_id] @target_id = hash[:target_id] end |
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
20 21 22 |
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20 def format @format end |
#metadata ⇒ Object
Returns the value of attribute metadata.
20 21 22 |
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20 def @metadata end |
#model_version ⇒ Object
Returns the value of attribute model_version.
20 21 22 |
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20 def model_version @model_version end |
#object ⇒ Object
Returns the value of attribute object.
20 21 22 |
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20 def object @object end |
#pae_object ⇒ Object
Returns the value of attribute pae_object.
20 21 22 |
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20 def pae_object @pae_object end |
#source ⇒ Object
Returns the value of attribute source.
20 21 22 |
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20 def source @source end |
#source_url ⇒ Object
Returns the value of attribute source_url.
20 21 22 |
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20 def source_url @source_url end |
#structure_id ⇒ Object
Returns the value of attribute structure_id.
20 21 22 |
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20 def structure_id @structure_id end |
#target_id ⇒ Object
Returns the value of attribute target_id.
20 21 22 |
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20 def target_id @target_id end |