Class: Rafflesia::StructureChainsData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::StructureChainsData
- Defined in:
- lib/rafflesia/proteins/structure_chains_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ chain_count: :chain_count, chains: :chains, format: :format, object: :object, parser: :parser, relation: :relation, source: :source, source_metadata: :source_metadata, structure_id: :structure_id, target_id: :target_id }.freeze
Instance Attribute Summary collapse
-
#chain_count ⇒ Object
Returns the value of attribute chain_count.
-
#chains ⇒ Object
Returns the value of attribute chains.
-
#format ⇒ Object
Returns the value of attribute format.
-
#object ⇒ Object
Returns the value of attribute object.
-
#parser ⇒ Object
Returns the value of attribute parser.
-
#relation ⇒ Object
Returns the value of attribute relation.
-
#source ⇒ Object
Returns the value of attribute source.
-
#source_metadata ⇒ Object
Returns the value of attribute source_metadata.
-
#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) ⇒ StructureChainsData
constructor
A new instance of StructureChainsData.
Constructor Details
#initialize(json) ⇒ StructureChainsData
Returns a new instance of StructureChainsData.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rafflesia/proteins/structure_chains_data.rb', line 33 def initialize(json) super() hash = self.class.normalize(json) @chain_count = hash[:chain_count] @chains = (hash[:chains] || []).map { |item| item ? Rafflesia::StructureChainRecord.new(item) : nil } @format = hash[:format] @object = hash[:object] ? Rafflesia::ObjectRef.new(hash[:object]) : nil @parser = hash[:parser] ? Rafflesia::StructureParserMetadata.new(hash[:parser]) : nil @relation = hash[:relation] ? Rafflesia::RelationArtifactData.new(hash[:relation]) : nil @source = hash[:source] @source_metadata = hash[:source_metadata] || {} @structure_id = hash[:structure_id] @target_id = hash[:target_id] end |
Instance Attribute Details
#chain_count ⇒ Object
Returns the value of attribute chain_count.
21 22 23 |
# File 'lib/rafflesia/proteins/structure_chains_data.rb', line 21 def chain_count @chain_count end |
#chains ⇒ Object
Returns the value of attribute chains.
21 22 23 |
# File 'lib/rafflesia/proteins/structure_chains_data.rb', line 21 def chains @chains end |
#format ⇒ Object
Returns the value of attribute format.
21 22 23 |
# File 'lib/rafflesia/proteins/structure_chains_data.rb', line 21 def format @format end |
#object ⇒ Object
Returns the value of attribute object.
21 22 23 |
# File 'lib/rafflesia/proteins/structure_chains_data.rb', line 21 def object @object end |
#parser ⇒ Object
Returns the value of attribute parser.
21 22 23 |
# File 'lib/rafflesia/proteins/structure_chains_data.rb', line 21 def parser @parser end |
#relation ⇒ Object
Returns the value of attribute relation.
21 22 23 |
# File 'lib/rafflesia/proteins/structure_chains_data.rb', line 21 def relation @relation end |
#source ⇒ Object
Returns the value of attribute source.
21 22 23 |
# File 'lib/rafflesia/proteins/structure_chains_data.rb', line 21 def source @source end |
#source_metadata ⇒ Object
Returns the value of attribute source_metadata.
21 22 23 |
# File 'lib/rafflesia/proteins/structure_chains_data.rb', line 21 def @source_metadata end |
#structure_id ⇒ Object
Returns the value of attribute structure_id.
21 22 23 |
# File 'lib/rafflesia/proteins/structure_chains_data.rb', line 21 def structure_id @structure_id end |
#target_id ⇒ Object
Returns the value of attribute target_id.
21 22 23 |
# File 'lib/rafflesia/proteins/structure_chains_data.rb', line 21 def target_id @target_id end |