Class: Rafflesia::MetalDetectData

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

Constant Summary collapse

HASH_ATTRS =
{
  max_distance: :max_distance,
  site_count: :site_count,
  sites: :sites,
  structure_id: :structure_id
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ MetalDetectData

Returns a new instance of MetalDetectData.



21
22
23
24
25
26
27
28
# File 'lib/rafflesia/proteins/metal_detect_data.rb', line 21

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @max_distance = hash[:max_distance]
  @site_count = hash[:site_count]
  @sites = (hash[:sites] || []).map { |item| item ? Rafflesia::MetalSiteRecord.new(item) : nil }
  @structure_id = hash[:structure_id]
end

Instance Attribute Details

#max_distanceObject

Returns the value of attribute max_distance.



15
16
17
# File 'lib/rafflesia/proteins/metal_detect_data.rb', line 15

def max_distance
  @max_distance
end

#site_countObject

Returns the value of attribute site_count.



15
16
17
# File 'lib/rafflesia/proteins/metal_detect_data.rb', line 15

def site_count
  @site_count
end

#sitesObject

Returns the value of attribute sites.



15
16
17
# File 'lib/rafflesia/proteins/metal_detect_data.rb', line 15

def sites
  @sites
end

#structure_idObject

Returns the value of attribute structure_id.



15
16
17
# File 'lib/rafflesia/proteins/metal_detect_data.rb', line 15

def structure_id
  @structure_id
end