Class: ActiveModel::Coercions::Types::Symbol
- Inherits:
-
Object
- Object
- ActiveModel::Coercions::Types::Symbol
- Defined in:
- lib/active_model/coercions/types/symbol.rb
Instance Method Summary collapse
-
#initialize(value) ⇒ Symbol
constructor
A new instance of Symbol.
- #to_value ⇒ Object
Constructor Details
#initialize(value) ⇒ Symbol
Returns a new instance of Symbol.
5 6 7 |
# File 'lib/active_model/coercions/types/symbol.rb', line 5 def initialize(value) @value = value end |
Instance Method Details
#to_value ⇒ Object
9 10 11 |
# File 'lib/active_model/coercions/types/symbol.rb', line 9 def to_value @value.to_sym end |