Class: Time

Inherits:
Object show all
Defined in:
lib/ripple/core_ext/casting.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.ripple_cast(value) ⇒ Object



111
112
113
114
# File 'lib/ripple/core_ext/casting.rb', line 111

def self.ripple_cast(value)
  return nil if value.blank?
  value.respond_to?(:to_time) && value.to_time or raise Ripple::PropertyTypeMismatch.new(self, value)
end

Instance Method Details

#as_json(options = {}) ⇒ Object



107
108
109
# File 'lib/ripple/core_ext/casting.rb', line 107

def as_json(options={})
  self.utc.send(Ripple.date_format)
end