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.
20 21 22 |
# File 'lib/osheet/format/fraction.rb', line 20 def initialize(opts={}) self.type = opts[:type] || :two_digits end |
Instance Method Details
#key ⇒ Object
28 29 30 |
# File 'lib/osheet/format/fraction.rb', line 28 def key "fraction_#{type_key.to_s.gsub('_', '')}" end |
#style ⇒ Object
24 25 26 |
# File 'lib/osheet/format/fraction.rb', line 24 def style "#\ #{type}" end |