Sha256: ac0f2e5b20507e543b2767726f5bdb63f0b6dac93557109d3dc069e076f6e7f4

Contents?: true

Size: 363 Bytes

Versions: 5

Compression:

Stored size: 363 Bytes

Contents

module Attributor
  class Symbol
    include Type

    def self.native_type
      ::Symbol
    end

    def self.load(value, context = Attributor::DEFAULT_ROOT_CONTEXT, **options)
      value.to_sym
    rescue
      super
    end

    def self.example(_context = nil, options: {})
      :example
    end

    def self.family
      String.family
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
attributor-5.4 lib/attributor/types/symbol.rb
attributor-5.3 lib/attributor/types/symbol.rb
attributor-5.2.1 lib/attributor/types/symbol.rb
attributor-5.2.0 lib/attributor/types/symbol.rb
attributor-5.1.0 lib/attributor/types/symbol.rb