Class: Mapper::ConstantsInGenotype::EmbeddedConstantData

Inherits:
Object
  • Object
show all
Defined in:
../lib/mapper_constants.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

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