Class: Waddup::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/waddup/event.rb

Overview

Denotes an event obtained from a source

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Event

Returns a new instance of Event.

Yields:

  • (_self)

Yield Parameters:

  • _self (Waddup::Event)

    the object that the method was called on



8
9
10
# File 'lib/waddup/event.rb', line 8

def initialize
  yield self if block_given?
end

Instance Attribute Details

#atObject

Returns the value of attribute at.



6
7
8
# File 'lib/waddup/event.rb', line 6

def at
  @at
end

#labelObject

Returns the value of attribute label.



6
7
8
# File 'lib/waddup/event.rb', line 6

def label
  @label
end

#sourceObject

Returns the value of attribute source.



6
7
8
# File 'lib/waddup/event.rb', line 6

def source
  @source
end

#untilObject

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