Class: Rafflesia::MetalDetectData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::MetalDetectData
- 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
-
#max_distance ⇒ Object
Returns the value of attribute max_distance.
-
#site_count ⇒ Object
Returns the value of attribute site_count.
-
#sites ⇒ Object
Returns the value of attribute sites.
-
#structure_id ⇒ Object
Returns the value of attribute structure_id.
Instance Method Summary collapse
-
#initialize(json) ⇒ MetalDetectData
constructor
A new instance of MetalDetectData.
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_distance ⇒ Object
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_count ⇒ Object
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 |
#sites ⇒ Object
Returns the value of attribute sites.
15 16 17 |
# File 'lib/rafflesia/proteins/metal_detect_data.rb', line 15 def sites @sites end |
#structure_id ⇒ Object
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 |