Class: Waddup::Event
- Inherits:
-
Object
- Object
- Waddup::Event
- Defined in:
- lib/waddup/event.rb
Overview
Denotes an event obtained from a source
Instance Attribute Summary collapse
-
#at ⇒ Object
Returns the value of attribute at.
-
#label ⇒ Object
Returns the value of attribute label.
-
#source ⇒ Object
Returns the value of attribute source.
-
#until ⇒ Object
Returns the value of attribute until.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Event
constructor
A new instance of Event.
- #to_json(state) ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ Event
Returns a new instance of Event.
8 9 10 |
# File 'lib/waddup/event.rb', line 8 def initialize yield self if block_given? end |
Instance Attribute Details
#at ⇒ Object
Returns the value of attribute at.
6 7 8 |
# File 'lib/waddup/event.rb', line 6 def at @at end |
#label ⇒ Object
Returns the value of attribute label.
6 7 8 |
# File 'lib/waddup/event.rb', line 6 def label @label end |
#source ⇒ Object
Returns the value of attribute source.
6 7 8 |
# File 'lib/waddup/event.rb', line 6 def source @source end |
#until ⇒ Object
Returns the value of attribute until.
6 7 8 |
# File 'lib/waddup/event.rb', line 6 def until @until end |
Instance Method Details
#to_json(state) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/waddup/event.rb', line 12 def to_json(state) { :label => label, :at => at, :until => @until, :source => source.class::ALIAS }.to_json end |