Class: Wrnap::Rna::Loop
- Inherits:
-
Object
- Object
- Wrnap::Rna::Loop
- Defined in:
- lib/wrnap/rna/motifs.rb
Instance Attribute Summary collapse
-
#i ⇒ Object
readonly
Returns the value of attribute i.
-
#j ⇒ Object
readonly
Returns the value of attribute j.
Instance Method Summary collapse
- #in(sequence) ⇒ Object
-
#initialize(i, j) ⇒ Loop
constructor
A new instance of Loop.
- #inspect ⇒ Object
- #length ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(i, j) ⇒ Loop
58 59 60 |
# File 'lib/wrnap/rna/motifs.rb', line 58 def initialize(i, j) @i, @j = i, j end |
Instance Attribute Details
#i ⇒ Object (readonly)
Returns the value of attribute i.
56 57 58 |
# File 'lib/wrnap/rna/motifs.rb', line 56 def i @i end |
#j ⇒ Object (readonly)
Returns the value of attribute j.
56 57 58 |
# File 'lib/wrnap/rna/motifs.rb', line 56 def j @j end |
Instance Method Details
#in(sequence) ⇒ Object
62 63 64 |
# File 'lib/wrnap/rna/motifs.rb', line 62 def in(sequence) sequence[i..j] end |
#inspect ⇒ Object
74 75 76 |
# File 'lib/wrnap/rna/motifs.rb', line 74 def inspect "#<Loop: %s>" % name end |
#length ⇒ Object
66 67 68 |
# File 'lib/wrnap/rna/motifs.rb', line 66 def length j - i + 1 end |
#name ⇒ Object
70 71 72 |
# File 'lib/wrnap/rna/motifs.rb', line 70 def name "(%d, %d [%d])" % [i, j, length] end |