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