Class: Jamef::Elegible
- Inherits:
-
Object
- Object
- Jamef::Elegible
- Includes:
- ActionView::Helpers::NumberHelper
- Defined in:
- lib/jamef/elegible.rb
Instance Attribute Summary collapse
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(operator, *args) ⇒ Elegible
constructor
A new instance of Elegible.
- #to_s ⇒ Object
Constructor Details
#initialize(operator, *args) ⇒ Elegible
Returns a new instance of Elegible.
6 7 8 9 |
# File 'lib/jamef/elegible.rb', line 6 def initialize(operator, *args) args = args.shift if args[0].kind_of?(Array) @total = args.inject(operator) end |
Instance Attribute Details
#total ⇒ Object (readonly)
Returns the value of attribute total.
4 5 6 |
# File 'lib/jamef/elegible.rb', line 4 def total @total end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/jamef/elegible.rb', line 11 def to_s number_to_currency(@total, separator: ",", delimiter: "", format: "%n") end |