Sha256: b72cab825360d539f18c552acfdfc1c78f53cce9812545c4fc034f4e79990ef2

Contents?: true

Size: 468 Bytes

Versions: 15

Compression:

Stored size: 468 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

15 entries across 15 versions & 1 rubygems

Version Path
osheet-1.0.0.rc.4 lib/osheet/format/special.rb
osheet-1.0.0.rc.3 lib/osheet/format/special.rb
osheet-1.0.0.rc.2 lib/osheet/format/special.rb
osheet-1.0.0.rc.1 lib/osheet/format/special.rb
osheet-0.10.0 lib/osheet/format/special.rb
osheet-0.9.2 lib/osheet/format/special.rb
osheet-0.9.1 lib/osheet/format/special.rb
osheet-0.9.0 lib/osheet/format/special.rb
osheet-0.8.0 lib/osheet/format/special.rb
osheet-0.7.0 lib/osheet/format/special.rb
osheet-0.6.0 lib/osheet/format/special.rb
osheet-0.5.0 lib/osheet/format/special.rb
osheet-0.4.0 lib/osheet/format/special.rb
osheet-0.3.0 lib/osheet/format/special.rb
osheet-0.2.0 lib/osheet/format/special.rb