Class: Hexpress::Modifier::Many
- Includes:
- Hexpress::Modifier, Value
- Defined in:
- lib/hexpress/modifier/many.rb,
lib/hexpress/verbal_expressions.rb
Constant Summary
Constants included from Hexpress::Modifier
Instance Method Summary collapse
-
#initialize(value, minimum = 1) ⇒ Many
constructor
A new instance of Many.
- #operator ⇒ Object
- #to_s ⇒ Object
Methods included from Hexpress::Modifier
Methods included from Value
Constructor Details
#initialize(value, minimum = 1) ⇒ Many
12 13 14 15 |
# File 'lib/hexpress/modifier/many.rb', line 12 def initialize(value, minimum = 1) @value = value @minimum = minimum end |
Instance Method Details
#operator ⇒ Object
17 18 19 20 21 22 |
# File 'lib/hexpress/modifier/many.rb', line 17 def operator case @minimum when 0 then "*" when 1 then "+" end end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/hexpress/verbal_expressions.rb', line 33 def to_s "#{open}#{value}#{operator}#{close}" end |