Created
October 23, 2010 06:29
-
-
Save nakao/641871 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bio' | |
class Bio::Sequence::NA | |
def self.compute_melting_temperature(nastr) | |
10 # code here ... | |
end | |
def melting_temperature | |
if @melting_temperature | |
@melting_temperature | |
else | |
@melting_temperature = self.class.compute_melting_temperature(self) | |
end | |
end | |
end | |
if __FILE__ == $0 | |
# as a class method (static method ?) | |
p Bio::Sequence::NA.compute_melting_temperature("ACGT") | |
# as an instance method | |
na = Bio::Sequence::NA.new("ACGT") | |
p na.melting_temperature | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment