class Strings::Numeral::Configuration
Public Class Methods
new()
click to toggle source
Initialize a configuration
@api private
# File lib/strings/numeral/configuration.rb, line 9 def initialize @currency = :usd @delimiter = ", " @decimal = :fraction @separator = nil @trailing_zeros = false end
Public Instance Methods
currency(value = (not_set = true))
click to toggle source
# File lib/strings/numeral/configuration.rb, line 17 def currency(value = (not_set = true)) if not_set @currency else @currency = value end end
decimal(value = (not_set = true))
click to toggle source
# File lib/strings/numeral/configuration.rb, line 41 def decimal(value = (not_set = true)) if not_set @decimal else @decimal = value end end
delimiter(value = (not_set = true))
click to toggle source
# File lib/strings/numeral/configuration.rb, line 25 def delimiter(value = (not_set = true)) if not_set @delimiter else @delimiter = value end end
separator(value = (not_set = true))
click to toggle source
# File lib/strings/numeral/configuration.rb, line 33 def separator(value = (not_set = true)) if not_set @separator else @separator = value end end
trailing_zeros(value = (not_set = true))
click to toggle source
# File lib/strings/numeral/configuration.rb, line 49 def trailing_zeros(value = (not_set = true)) if not_set @trailing_zeros else @trailing_zeros = value end end