Class: CsvBlueprints::RepeatedValue
- Inherits:
-
Object
- Object
- CsvBlueprints::RepeatedValue
- Defined in:
- lib/csv_blueprints/blueprint.rb
Instance Method Summary collapse
- #call(index) ⇒ Object
-
#initialize(callable, max_repetitions) ⇒ RepeatedValue
constructor
A new instance of RepeatedValue.
Constructor Details
#initialize(callable, max_repetitions) ⇒ RepeatedValue
Returns a new instance of RepeatedValue.
13 14 15 16 17 18 |
# File 'lib/csv_blueprints/blueprint.rb', line 13 def initialize(callable, max_repetitions) @callable = callable @max_repetitions = max_repetitions @repetitions = 0 @value = nil end |
Instance Method Details
#call(index) ⇒ Object
20 21 22 23 24 |
# File 'lib/csv_blueprints/blueprint.rb', line 20 def call(index) calculate_value(index) increment_repetitions value end |