Class: Rafflesia::SequenceData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::SequenceData
- Defined in:
- lib/rafflesia/sequences/sequence_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ header: :header, length: :length, object: :object, retrieved_at: :retrieved_at, sequence: :sequence, sequence_id: :sequence_id, sha256: :sha_256, source: :source, source_url: :source_url, target_id: :target_id }.freeze
Instance Attribute Summary collapse
-
#header ⇒ Object
Returns the value of attribute header.
-
#length ⇒ Object
Returns the value of attribute length.
-
#object ⇒ Object
Returns the value of attribute object.
-
#retrieved_at ⇒ Object
Returns the value of attribute retrieved_at.
-
#sequence ⇒ Object
Returns the value of attribute sequence.
-
#sequence_id ⇒ Object
Returns the value of attribute sequence_id.
-
#sha_256 ⇒ Object
Returns the value of attribute sha_256.
-
#source ⇒ Object
Returns the value of attribute source.
-
#source_url ⇒ Object
Returns the value of attribute source_url.
-
#target_id ⇒ Object
Returns the value of attribute target_id.
Instance Method Summary collapse
-
#initialize(json) ⇒ SequenceData
constructor
A new instance of SequenceData.
Constructor Details
#initialize(json) ⇒ SequenceData
Returns a new instance of SequenceData.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rafflesia/sequences/sequence_data.rb', line 33 def initialize(json) super() hash = self.class.normalize(json) @header = hash[:header] @length = hash[:length] @object = hash[:object] ? Rafflesia::ObjectRef.new(hash[:object]) : nil @retrieved_at = hash[:retrieved_at] @sequence = hash[:sequence] @sequence_id = hash[:sequence_id] @sha_256 = hash[:sha256] @source = hash[:source] @source_url = hash[:source_url] @target_id = hash[:target_id] end |
Instance Attribute Details
#header ⇒ Object
Returns the value of attribute header.
21 22 23 |
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21 def header @header end |
#length ⇒ Object
Returns the value of attribute length.
21 22 23 |
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21 def length @length end |
#object ⇒ Object
Returns the value of attribute object.
21 22 23 |
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21 def object @object end |
#retrieved_at ⇒ Object
Returns the value of attribute retrieved_at.
21 22 23 |
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21 def retrieved_at @retrieved_at end |
#sequence ⇒ Object
Returns the value of attribute sequence.
21 22 23 |
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21 def sequence @sequence end |
#sequence_id ⇒ Object
Returns the value of attribute sequence_id.
21 22 23 |
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21 def sequence_id @sequence_id end |
#sha_256 ⇒ Object
Returns the value of attribute sha_256.
21 22 23 |
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21 def sha_256 @sha_256 end |
#source ⇒ Object
Returns the value of attribute source.
21 22 23 |
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21 def source @source end |
#source_url ⇒ Object
Returns the value of attribute source_url.
21 22 23 |
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21 def source_url @source_url end |
#target_id ⇒ Object
Returns the value of attribute target_id.
21 22 23 |
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21 def target_id @target_id end |