Sha256: 1891f9bf37a6f7413098bc17d485c0ba67e30808efde13db9a73128e539b695c

Contents?: true

Size: 432 Bytes

Versions: 18

Compression:

Stored size: 432 Bytes

Contents

module Superstore
  module Types
    class BaseType
      attr_accessor :options
      def initialize(options = {})
        @options = options
      end

      def default
        options[:default].duplicable? ? options[:default].dup : options[:default]
      end

      def encode(value)
        value.to_s
      end

      def decode(str)
        str
      end

      def typecast(value)
        value
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
superstore-1.2.0 lib/superstore/types/base_type.rb
superstore-1.1.4 lib/superstore/types/base_type.rb
superstore-1.1.3 lib/superstore/types/base_type.rb
superstore-1.1.2 lib/superstore/types/base_type.rb
superstore-1.1.1 lib/superstore/types/base_type.rb
superstore-1.1.0 lib/superstore/types/base_type.rb
superstore-1.0.12 lib/superstore/types/base_type.rb
superstore-1.0.11 lib/superstore/types/base_type.rb
superstore-1.0.10 lib/superstore/types/base_type.rb
superstore-1.0.9 lib/superstore/types/base_type.rb
superstore-1.0.8 lib/superstore/types/base_type.rb
superstore-1.0.7 lib/superstore/types/base_type.rb
superstore-1.0.6 lib/superstore/types/base_type.rb
superstore-1.0.5 lib/superstore/types/base_type.rb
superstore-1.0.4 lib/superstore/types/base_type.rb
superstore-1.0.3 lib/superstore/types/base_type.rb
superstore-1.0.2 lib/superstore/types/base_type.rb
superstore-1.0.0 lib/superstore/types/base_type.rb