Class: MoneyRails::ActiveModel::MoneyValidator::Details
- Inherits:
-
Struct
- Object
- Struct
- MoneyRails::ActiveModel::MoneyValidator::Details
- Defined in:
- lib/money-rails/active_model/validator.rb
Instance Attribute Summary collapse
-
#decimal_mark ⇒ Object
Returns the value of attribute decimal_mark.
-
#raw_value ⇒ Object
Returns the value of attribute raw_value.
-
#thousands_separator ⇒ Object
Returns the value of attribute thousands_separator.
Instance Method Summary collapse
Instance Attribute Details
#decimal_mark ⇒ Object
Returns the value of attribute decimal_mark
4 5 6 |
# File 'lib/money-rails/active_model/validator.rb', line 4 def decimal_mark @decimal_mark end |
#raw_value ⇒ Object
Returns the value of attribute raw_value
4 5 6 |
# File 'lib/money-rails/active_model/validator.rb', line 4 def raw_value @raw_value end |
#thousands_separator ⇒ Object
Returns the value of attribute thousands_separator
4 5 6 |
# File 'lib/money-rails/active_model/validator.rb', line 4 def thousands_separator @thousands_separator end |
Instance Method Details
#abs_raw_value ⇒ Object
5 6 7 |
# File 'lib/money-rails/active_model/validator.rb', line 5 def abs_raw_value @abs_raw_value ||= raw_value.to_s.sub(/^\s*-/, "").strip end |
#decimal_pieces ⇒ Object
9 10 11 |
# File 'lib/money-rails/active_model/validator.rb', line 9 def decimal_pieces @decimal_pieces ||= abs_raw_value.split(decimal_mark) end |