Class: Fasta

Inherits:
Record show all
Defined in:
lib/dna/parsers/fasta.rb

Overview

Fasta record

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Record

#length

Constructor Details

#initialize(args = {}) ⇒ Fasta

Returns a new instance of Fasta.



32
33
34
35
# File 'lib/dna/parsers/fasta.rb', line 32

def initialize(args={})
  @name = args[:name]
  @sequence = args[:sequence]
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



30
31
32
# File 'lib/dna/parsers/fasta.rb', line 30

def name
  @name
end

#sequenceObject

Returns the value of attribute sequence.



30
31
32
# File 'lib/dna/parsers/fasta.rb', line 30

def sequence
  @sequence
end

Instance Method Details

#to_sObject



37
38
39
# File 'lib/dna/parsers/fasta.rb', line 37

def to_s
  ">#{@name}\n#{@sequence}"
end