Class: Fasta

Inherits:
Record show all
Defined in:
lib/dna.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.



62
63
64
65
# File 'lib/dna.rb', line 62

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



60
61
62
# File 'lib/dna.rb', line 60

def name
  @name
end

#sequenceObject

Returns the value of attribute sequence.



60
61
62
# File 'lib/dna.rb', line 60

def sequence
  @sequence
end

Instance Method Details

#to_sObject



67
68
69
# File 'lib/dna.rb', line 67

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