Class: Virtus::Coercion::Object

Inherits:
Virtus::Coercion show all
Defined in:
lib/virtus/coercion/object.rb

Overview

Coerce Object values

Direct Known Subclasses

Array, Date, DateTime, FalseClass, Hash, Numeric, String, Symbol, Time, TrueClass

Constant Summary collapse

COERCION_METHOD_REGEXP =
/\Ato_/.freeze

Constants included from TypeLookup

TypeLookup::EXTRA_CONST_ARGS, TypeLookup::TYPE_FORMAT

Class Method Summary collapse

Methods inherited from Virtus::Coercion

[]

Methods included from DescendantsTracker

#add_descendant, #descendants

Methods included from TypeLookup

#determine_type, #primitive

Methods included from Options

#accept_options, #accepted_options, #options

Class Method Details

.method_missing(method, *args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Passthrough given value

Parameters:

Returns:



17
18
19
20
21
22
23
# File 'lib/virtus/coercion/object.rb', line 17

def self.method_missing(method, *args)
  if method.to_s =~ COERCION_METHOD_REGEXP && args.size == 1
    args.first
  else
    super
  end
end