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.
126 127 128 |
# File 'lib/wrnap/rna/constraints.rb', line 126 def initialize(from, to, symbol) @from, @to, @symbol = from, to, symbol end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
124 125 126 |
# File 'lib/wrnap/rna/constraints.rb', line 124 def from @from end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
124 125 126 |
# File 'lib/wrnap/rna/constraints.rb', line 124 def symbol @symbol end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
124 125 126 |
# File 'lib/wrnap/rna/constraints.rb', line 124 def to @to end |
Instance Method Details
#inspect ⇒ Object
138 139 140 |
# File 'lib/wrnap/rna/constraints.rb', line 138 def inspect "#<Constraint: %s>" % name end |
#length ⇒ Object
134 135 136 |
# File 'lib/wrnap/rna/constraints.rb', line 134 def length to - from + 1 end |
#name ⇒ Object
130 131 132 |
# File 'lib/wrnap/rna/constraints.rb', line 130 def name "(%d to %d as '%s')" % [from, to, symbol] end |