Class: Mapper::ConstantsInGenotype::EmbeddedConstantData
- Inherits:
-
Object
- Object
- Mapper::ConstantsInGenotype::EmbeddedConstantData
- Defined in:
- ../lib/mapper_constants.rb
Instance Attribute Summary (collapse)
-
- (Object) codons
readonly
Returns the value of attribute codons.
-
- (Object) min
readonly
Returns the value of attribute min.
-
- (Object) step
readonly
Returns the value of attribute step.
-
- (Object) type
readonly
Returns the value of attribute type.
Instance Method Summary (collapse)
-
- (EmbeddedConstantData) initialize(type, codons, min, step)
constructor
A new instance of EmbeddedConstantData.
- - (Object) mapping(index)
Constructor Details
- (EmbeddedConstantData) initialize(type, codons, min, step)
A new instance of EmbeddedConstantData
10 11 12 13 14 15 |
# File '../lib/mapper_constants.rb', line 10 def initialize( type, codons, min, step ) @type = type @codons = codons @min = min @step = step end |
Instance Attribute Details
- (Object) codons (readonly)
Returns the value of attribute codons
8 9 10 |
# File '../lib/mapper_constants.rb', line 8 def codons @codons end |
- (Object) min (readonly)
Returns the value of attribute min
8 9 10 |
# File '../lib/mapper_constants.rb', line 8 def min @min end |
- (Object) step (readonly)
Returns the value of attribute step
8 9 10 |
# File '../lib/mapper_constants.rb', line 8 def step @step end |
- (Object) type (readonly)
Returns the value of attribute type
8 9 10 |
# File '../lib/mapper_constants.rb', line 8 def type @type end |
Instance Method Details
- (Object) mapping(index)
17 18 19 20 |
# File '../lib/mapper_constants.rb', line 17 def mapping index value = @min + @step * index (@type == Integer) ? value.round : value end |