Sha256: d8fcef43a7541d2ddeffafa2effc27f9e939facea705e1b5b426cb960b0926d7

Contents?: true

Size: 764 Bytes

Versions: 11

Compression:

Stored size: 764 Bytes

Contents

require 'osheet/format/general'
require 'osheet/format/number'
require 'osheet/format/currency'
require 'osheet/format/accounting'
require 'osheet/format/datetime'
require 'osheet/format/percentage'
require 'osheet/format/fraction'
require 'osheet/format/scientific'
require 'osheet/format/text'
require 'osheet/format/special'
require 'osheet/format/custom'

module Osheet::Format

  VALUES = [
    :general,:number, :currency, :accounting,
    :datetime, :percentage, :fraction, :scientific,
    :text, :special, :custom
  ]

  class << self
    def new(type, opts={})
      unless VALUES.include?(type)
        raise ArgumentError, "'#{type.inspect}' is not a valid format type"
      end
      self.const_get(type.to_s.capitalize).new(opts)
    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
osheet-0.10.0 lib/osheet/format.rb
osheet-0.9.2 lib/osheet/format.rb
osheet-0.9.1 lib/osheet/format.rb
osheet-0.9.0 lib/osheet/format.rb
osheet-0.8.0 lib/osheet/format.rb
osheet-0.7.0 lib/osheet/format.rb
osheet-0.6.0 lib/osheet/format.rb
osheet-0.5.0 lib/osheet/format.rb
osheet-0.4.0 lib/osheet/format.rb
osheet-0.3.0 lib/osheet/format.rb
osheet-0.2.0 lib/osheet/format.rb