Class: Virtus::Coercion::Symbol

Inherits:
Object show all
Defined in:
lib/virtus/coercion/symbol.rb

Overview

Coerce Symbol values

Constant Summary

Constants inherited from Object

Object::COERCION_METHOD_REGEXP

Constants included from TypeLookup

TypeLookup::TYPE_FORMAT

Class Method Summary collapse

Methods inherited from Object

to_array, to_hash, to_integer

Methods inherited from Virtus::Coercion

[]

Methods included from TypeLookup

#determine_type, extended, #primitive

Methods included from Options

#accept_options, #accepted_options, #options

Class Method Details

.to_string(value) ⇒ String

Coerce given value to String

Examples:

Virtus::Coercion::Symbol.to_string(:name)  # => "name"

Parameters:

Returns:



18
19
20
# File 'lib/virtus/coercion/symbol.rb', line 18

def self.to_string(value)
  value.to_s
end