lib/parse_fasta.rb in parse_fasta-0.0.2 vs lib/parse_fasta.rb in parse_fasta-0.0.3
- old
+ new
@@ -11,17 +11,18 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-def parse_line(line)
- line.chomp.split("\n", 2).map { |s| s.gsub(/\n|>/, '') }
-end
-
class File
def each_record
self.each("\n>") do |line|
header, sequence = parse_line(line)
yield header.strip, sequence
end
+ end
+
+ private
+ def parse_line(line)
+ line.chomp.split("\n", 2).map { |s| s.gsub(/\n|>/, '') }
end
end