Class: Rafflesia::StructureData

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

Instance Method Summary collapse

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

#formatObject

Returns the value of attribute format.



20
21
22
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20

def format
  @format
end

#metadataObject

Returns the value of attribute metadata.



20
21
22
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20

def 
  @metadata
end

#model_versionObject

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

#objectObject

Returns the value of attribute object.



20
21
22
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20

def object
  @object
end

#pae_objectObject

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

#sourceObject

Returns the value of attribute source.



20
21
22
# File 'lib/rafflesia/artifacts/structure_data.rb', line 20

def source
  @source
end

#source_urlObject

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_idObject

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_idObject

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