Class: Rafflesia::PocketDetectData

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

Constant Summary collapse

HASH_ATTRS =
{
  backend: :backend,
  cache_hit: :cache_hit,
  cache_key: :cache_key,
  cache_mode: :cache_mode,
  objects: :objects,
  pockets: :pockets,
  relation: :relation,
  structure_id: :structure_id
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ PocketDetectData

Returns a new instance of PocketDetectData.



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rafflesia/proteins/pocket_detect_data.rb', line 29

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @backend = hash[:backend]
  @cache_hit = hash[:cache_hit]
  @cache_key = hash[:cache_key]
  @cache_mode = hash[:cache_mode]
  @objects = (hash[:objects] || []).map { |item| item ? Rafflesia::ObjectRef.new(item) : nil }
  @pockets = (hash[:pockets] || []).map { |item| item ? Rafflesia::Pocket.new(item) : nil }
  @relation = hash[:relation] ? Rafflesia::RelationArtifactData.new(hash[:relation]) : nil
  @structure_id = hash[:structure_id]
end

Instance Attribute Details

#backendObject

Returns the value of attribute backend.



19
20
21
# File 'lib/rafflesia/proteins/pocket_detect_data.rb', line 19

def backend
  @backend
end

#cache_hitObject

Returns the value of attribute cache_hit.



19
20
21
# File 'lib/rafflesia/proteins/pocket_detect_data.rb', line 19

def cache_hit
  @cache_hit
end

#cache_keyObject

Returns the value of attribute cache_key.



19
20
21
# File 'lib/rafflesia/proteins/pocket_detect_data.rb', line 19

def cache_key
  @cache_key
end

#cache_modeObject

Returns the value of attribute cache_mode.



19
20
21
# File 'lib/rafflesia/proteins/pocket_detect_data.rb', line 19

def cache_mode
  @cache_mode
end

#objectsObject

Returns the value of attribute objects.



19
20
21
# File 'lib/rafflesia/proteins/pocket_detect_data.rb', line 19

def objects
  @objects
end

#pocketsObject

Returns the value of attribute pockets.



19
20
21
# File 'lib/rafflesia/proteins/pocket_detect_data.rb', line 19

def pockets
  @pockets
end

#relationObject

Returns the value of attribute relation.



19
20
21
# File 'lib/rafflesia/proteins/pocket_detect_data.rb', line 19

def relation
  @relation
end

#structure_idObject

Returns the value of attribute structure_id.



19
20
21
# File 'lib/rafflesia/proteins/pocket_detect_data.rb', line 19

def structure_id
  @structure_id
end