Class: Osheet::Format::Fraction
- Inherits:
-
Object
- Object
- Osheet::Format::Fraction
- Includes:
- Enumeration
- Defined in:
- lib/osheet/format/fraction.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Fraction
constructor
A new instance of Fraction.
- #key ⇒ Object
- #style ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Fraction
Returns a new instance of Fraction.
19 20 21 |
# File 'lib/osheet/format/fraction.rb', line 19 def initialize(opts={}) self.type = opts[:type] || :two_digits end |
Instance Method Details
#key ⇒ Object
27 28 29 |
# File 'lib/osheet/format/fraction.rb', line 27 def key "fraction_#{type_key.to_s.gsub('_', '')}" end |
#style ⇒ Object
23 24 25 |
# File 'lib/osheet/format/fraction.rb', line 23 def style "#\ #{type}" end |