Class: Rafflesia::SequenceData

Inherits:
Types::BaseModel
  • Object
show all
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

Instance Method Summary collapse

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

#headerObject

Returns the value of attribute header.



21
22
23
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21

def header
  @header
end

#lengthObject

Returns the value of attribute length.



21
22
23
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21

def length
  @length
end

#objectObject

Returns the value of attribute object.



21
22
23
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21

def object
  @object
end

#retrieved_atObject

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

#sequenceObject

Returns the value of attribute sequence.



21
22
23
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21

def sequence
  @sequence
end

#sequence_idObject

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_256Object

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

#sourceObject

Returns the value of attribute source.



21
22
23
# File 'lib/rafflesia/sequences/sequence_data.rb', line 21

def source
  @source
end

#source_urlObject

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_idObject

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