Class: Rafflesia::ComplexImportData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/proteins/complex_import_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  chain_count: :chain_count,
  chains: :chains,
  format: :format,
  is_complex: :is_complex,
  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) ⇒ ComplexImportData

Returns a new instance of ComplexImportData.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 37

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @chain_count = hash[:chain_count]
  @chains = (hash[:chains] || []).map { |item| item ? Rafflesia::ChainSummary.new(item) : nil }
  @format = hash[:format]
  @is_complex = hash[:is_complex]
  @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

#chain_countObject

Returns the value of attribute chain_count.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def chain_count
  @chain_count
end

#chainsObject

Returns the value of attribute chains.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def chains
  @chains
end

#formatObject

Returns the value of attribute format.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def format
  @format
end

#is_complexObject

Returns the value of attribute is_complex.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def is_complex
  @is_complex
end

#metadataObject

Returns the value of attribute metadata.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def 
  @metadata
end

#model_versionObject

Returns the value of attribute model_version.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def model_version
  @model_version
end

#objectObject

Returns the value of attribute object.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def object
  @object
end

#pae_objectObject

Returns the value of attribute pae_object.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def pae_object
  @pae_object
end

#sourceObject

Returns the value of attribute source.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def source
  @source
end

#source_urlObject

Returns the value of attribute source_url.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def source_url
  @source_url
end

#structure_idObject

Returns the value of attribute structure_id.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def structure_id
  @structure_id
end

#target_idObject

Returns the value of attribute target_id.



23
24
25
# File 'lib/rafflesia/proteins/complex_import_data.rb', line 23

def target_id
  @target_id
end