Class: MoneyRails::ActiveModel::MoneyValidator::Details

Inherits:
Struct
  • Object
show all
Defined in:
lib/money-rails/active_model/validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#decimal_markObject

Returns the value of attribute decimal_mark

Returns:

  • (Object)

    the current value of decimal_mark



4
5
6
# File 'lib/money-rails/active_model/validator.rb', line 4

def decimal_mark
  @decimal_mark
end

#raw_valueObject

Returns the value of attribute raw_value

Returns:

  • (Object)

    the current value of raw_value



4
5
6
# File 'lib/money-rails/active_model/validator.rb', line 4

def raw_value
  @raw_value
end

#thousands_separatorObject

Returns the value of attribute thousands_separator

Returns:

  • (Object)

    the current value of 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_valueObject



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_piecesObject



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