Coercible::Coercer::Object
Coerce Hash values
Creates a Date instance from a Hash
Valid keys are: :year, :month, :day, :hour
@param [Hash] value
@return [Date]
@api private
# File lib/coercible/coercer/hash.rb, line 32 def to_date(value) ::Date.new(*extract(value).first(3)) end
Creates a DateTime instance from a Hash
Valid keys are: :year, :month, :day, :hour, :min, :sec
@return [DateTime]
# File lib/coercible/coercer/hash.rb, line 45 def to_datetime(value) ::DateTime.new(*extract(value)) end
Creates a Time instance from a Hash
@return [Time]
# File lib/coercible/coercer/hash.rb, line 19 def to_time(value) ::Time.local(*extract(value)) end
[Validate]
Generated with the Darkfish Rdoc Generator 2.