Sha256: ea28273bb2aa2e749b8d3db4f0a4987ea6de96723bd83347322566d66363427a

Contents?: true

Size: 467 Bytes

Versions: 3

Compression:

Stored size: 467 Bytes

Contents

require 'enumeration'

module Osheet::Format
  class Special
    include Enumeration

    enum(:type, {
      :zip_code => '00000',
      :zip_code_plus_4 => '00000-0000',
      :phone_number => '[<=9999999]###-####;(###) ###-####',
      :social_security_number => '000-00-0000'
    })

    def initialize(opts={})
      self.type = opts[:type]
    end

    def style
      type
    end

    def key
      "special_#{type_key.to_s.gsub('_', '')}"
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
osheet-1.1.1 lib/osheet/format/special.rb
osheet-1.1.0 lib/osheet/format/special.rb
osheet-1.0.0 lib/osheet/format/special.rb