Sha256: f88d8d4ed13dbf3be78fb2b23a01ed11b6a4d3e690fe785ed366b119c81cc447

Contents?: true

Size: 426 Bytes

Versions: 14

Compression:

Stored size: 426 Bytes

Contents

module Rasti
  class Form
    module Types
      class Symbol
        class << self

          include Castable
        
          private

          def valid?(value)
            !value.nil? && (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
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rasti-form-3.1.2 lib/rasti/form/types/symbol.rb
rasti-form-3.1.1 lib/rasti/form/types/symbol.rb
rasti-form-3.1.0 lib/rasti/form/types/symbol.rb
rasti-form-3.0.0 lib/rasti/form/types/symbol.rb
rasti-form-2.2.0 lib/rasti/form/types/symbol.rb
rasti-form-2.1.0 lib/rasti/form/types/symbol.rb
rasti-form-2.0.0 lib/rasti/form/types/symbol.rb
rasti-form-1.1.1 lib/rasti/form/types/symbol.rb
rasti-form-1.1.0 lib/rasti/form/types/symbol.rb
rasti-form-1.0.3 lib/rasti/form/types/symbol.rb
rasti-form-1.0.2 lib/rasti/form/types/symbol.rb
rasti-form-1.0.1 lib/rasti/form/types/symbol.rb
rasti-form-1.0.0 lib/rasti/form/types/symbol.rb
rasti-form-0.1.0 lib/rasti/form/types/symbol.rb