Module: Cabin::Mixins::Timestamp
- Included in:
- Channel
- Defined in:
- lib/cabin/mixins/timestamp.rb
Overview
Timestamp events before publishing.
Class Method Summary collapse
Class Method Details
.extended(instance) ⇒ Object
5 6 7 |
# File 'lib/cabin/mixins/timestamp.rb', line 5 def self.extended(instance) self.included(instance.class) end |
.included(klass) ⇒ Object
8 9 10 11 12 |
# File 'lib/cabin/mixins/timestamp.rb', line 8 def self.included(klass) klass.action do |event| event[:timestamp] = Time.now.strftime("%Y-%m-%dT%H:%M:%S.%6N%z") end end |