Class: Parameters::Types::Symbol Private
- Defined in:
- lib/parameters/types/symbol.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
-
.coerce(value) ⇒ ::Symbol
private
Coerces a value into a Symbol.
Methods inherited from Object
Methods inherited from Type
#<, #<=, #==, ===, #===, #coerce, #to_ruby, to_ruby
Class Method Details
.coerce(value) ⇒ ::Symbol
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.
Coerces a value into a Symbol.
16 17 18 19 20 21 22 |
# File 'lib/parameters/types/symbol.rb', line 16 def self.coerce(value) if value.respond_to?(:to_sym) value.to_sym else value.to_s.to_sym end end |