Class: Wrnap::Rna::Constraints::ConstraintData

Inherits:
Object
  • Object
show all
Defined in:
lib/wrnap/rna/constraints.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fromObject (readonly)

Returns the value of attribute from.



124
125
126
# File 'lib/wrnap/rna/constraints.rb', line 124

def from
  @from
end

#symbolObject (readonly)

Returns the value of attribute symbol.



124
125
126
# File 'lib/wrnap/rna/constraints.rb', line 124

def symbol
  @symbol
end

#toObject (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

#inspectObject



138
139
140
# File 'lib/wrnap/rna/constraints.rb', line 138

def inspect
  "#<Constraint: %s>" % name
end

#lengthObject



134
135
136
# File 'lib/wrnap/rna/constraints.rb', line 134

def length
  to - from + 1
end

#nameObject



130
131
132
# File 'lib/wrnap/rna/constraints.rb', line 130

def name
  "(%d to %d as '%s')" % [from, to, symbol]
end