exercism/ruby/rna-transcription/rna_transcription.rb

8 lines
156 B
Ruby
Raw Normal View History

2018-09-27 12:05:28 -04:00
class Complement
RNA_MAP = {G: 'C', C: 'G', T: 'A', A: 'U'}
def self.of_dna(dna_strand)
dna_strand.chars.map{|n| RNA_MAP[n.to_sym]}.join
end
end