Sha256: cb2555cf5663ec42171f710a778ac915a6e1089d4499a27d79e7b3fdac32ef3a

Contents?: true

Size: 615 Bytes

Versions: 9

Compression:

Stored size: 615 Bytes

Contents

module Virtus

  # Coerce abstract class
  #
  # @abstract
  #
  class Coercion
    extend DescendantsTracker
    extend TypeLookup
    extend Options

    accept_options :primitive

    # Return a class that matches given name
    #
    # Defaults to Virtus::Coercion::Object
    #
    # @example
    #   Virtus::Coercion['String'] # => Virtus::Coercion::String
    #   Virtus::Coercion[String]   # => Virtus::Coercion::String
    #
    # @param [String]
    #
    # @return [Class]
    #
    # @api private
    def self.[](name)
      determine_type(name) or Coercion::Object
    end

  end # Coerce
end # Virtus

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
virtus-0.5.5 lib/virtus/coercion.rb
virtus-0.5.4 lib/virtus/coercion.rb
virtus-0.5.3 lib/virtus/coercion.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/lib/virtus/coercion.rb
virtus-0.5.2 lib/virtus/coercion.rb
virtus-0.5.1 lib/virtus/coercion.rb
virtus-0.5.0 lib/virtus/coercion.rb
virtus-0.4.2 lib/virtus/coercion.rb
virtus-0.4.1 lib/virtus/coercion.rb