Class: Rafflesia::FoldSegmentGenerationData

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

Constant Summary collapse

HASH_ATTRS =
{
  activated: :activated,
  active_ref: :active_ref,
  name: :name,
  previous_active: :previous_active,
  previous_active_ref: :previous_active_ref,
  reason: :reason,
  records: :records,
  transitioned_at: :transitioned_at
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FoldSegmentGenerationData

Returns a new instance of FoldSegmentGenerationData.



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

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @activated = hash[:activated] ? Rafflesia::FoldSegmentPublishData.new(hash[:activated]) : nil
  @active_ref = hash[:active_ref]
  @name = hash[:name]
  @previous_active = hash[:previous_active] ? Rafflesia::FoldSegmentPublishData.new(hash[:previous_active]) : nil
  @previous_active_ref = hash[:previous_active_ref]
  @reason = hash[:reason]
  @records = (hash[:records] || []).map { |item| item ? Rafflesia::FoldSegmentPublishData.new(item) : nil }
  @transitioned_at = hash[:transitioned_at]
end

Instance Attribute Details

#activatedObject

Returns the value of attribute activated.



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

def activated
  @activated
end

#active_refObject

Returns the value of attribute active_ref.



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

def active_ref
  @active_ref
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#previous_activeObject

Returns the value of attribute previous_active.



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

def previous_active
  @previous_active
end

#previous_active_refObject

Returns the value of attribute previous_active_ref.



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

def previous_active_ref
  @previous_active_ref
end

#reasonObject

Returns the value of attribute reason.



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

def reason
  @reason
end

#recordsObject

Returns the value of attribute records.



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

def records
  @records
end

#transitioned_atObject

Returns the value of attribute transitioned_at.



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

def transitioned_at
  @transitioned_at
end