Class: Osheet::Format::Numeric
- Inherits:
-
Object
- Object
- Osheet::Format::Numeric
- Includes:
- Enumeration
- Defined in:
- lib/osheet/format/numeric.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#comma_separator ⇒ Object
Returns the value of attribute comma_separator.
-
#decimal_places ⇒ Object
Returns the value of attribute decimal_places.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Numeric
constructor
A new instance of Numeric.
- #key ⇒ Object
- #style ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Numeric
Returns a new instance of Numeric.
14 15 16 17 18 19 |
# File 'lib/osheet/format/numeric.rb', line 14 def initialize(opts={}) self.symbol = opts[:symbol] || :none self.decimal_places = opts[:decimal_places] || 0 self.comma_separator = opts.has_key?(:comma_separator) ? opts[:comma_separator] : false self.negative_numbers = opts[:negative_numbers] || :black end |
Instance Attribute Details
#comma_separator ⇒ Object
Returns the value of attribute comma_separator.
10 11 12 |
# File 'lib/osheet/format/numeric.rb', line 10 def comma_separator @comma_separator end |
#decimal_places ⇒ Object
Returns the value of attribute decimal_places.
10 11 12 |
# File 'lib/osheet/format/numeric.rb', line 10 def decimal_places @decimal_places end |
Instance Method Details
#key ⇒ Object
36 37 38 |
# File 'lib/osheet/format/numeric.rb', line 36 def key "#{key_prefix}_#{symbol_key}_#{decimal_places_key}_#{comma_separator_key}_#{negative_numbers_key}" end |
#style ⇒ Object
32 33 34 |
# File 'lib/osheet/format/numeric.rb', line 32 def style negative_numbers_style end |