Class: Wrnap::Rna::Constraints::ConstraintData
- Inherits:
-
Object
- Object
- Wrnap::Rna::Constraints::ConstraintData
- Defined in:
- lib/wrnap/rna/constraints.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(from, to, symbol) ⇒ ConstraintData
constructor
A new instance of ConstraintData.
- #inspect ⇒ Object
- #length ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(from, to, symbol) ⇒ ConstraintData
Returns a new instance of ConstraintData.
124 125 126 |
# File 'lib/wrnap/rna/constraints.rb', line 124 def initialize(from, to, symbol) @from, @to, @symbol = from, to, symbol end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
122 123 124 |
# File 'lib/wrnap/rna/constraints.rb', line 122 def from @from end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
122 123 124 |
# File 'lib/wrnap/rna/constraints.rb', line 122 def symbol @symbol end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
122 123 124 |
# File 'lib/wrnap/rna/constraints.rb', line 122 def to @to end |
Instance Method Details
#inspect ⇒ Object
136 137 138 |
# File 'lib/wrnap/rna/constraints.rb', line 136 def inspect "#<Constraint: %s>" % name end |
#length ⇒ Object
132 133 134 |
# File 'lib/wrnap/rna/constraints.rb', line 132 def length to - from + 1 end |
#name ⇒ Object
128 129 130 |
# File 'lib/wrnap/rna/constraints.rb', line 128 def name "(%d to %d as '%s')" % [from, to, symbol] end |