Sha256: 8da6c55eddd4a24d4dca6b50c0ddc3ceacc8b216c78d922161649bc7770f6f64

Contents?: true

Size: 354 Bytes

Versions: 2

Compression:

Stored size: 354 Bytes

Contents

module Rasti
  module Types
    class Symbol
      class << self

        include Castable

        private

        def valid?(value)
          value.respond_to?(:to_sym) || value.respond_to?(:to_s)
        end

        def transform(value)
          value.respond_to?(:to_sym) ? value.to_sym : value.to_s.to_sym
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rasti-types-2.0.1 lib/rasti/types/symbol.rb
rasti-types-2.0.0 lib/rasti/types/symbol.rb