Class: Frequencyio::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/frequencyio/channel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, token) ⇒ Channel

Returns a new instance of Channel.



7
8
9
10
# File 'lib/frequencyio/channel.rb', line 7

def initialize(id, token)
  @channel_id = id
  @token      = token
end

Instance Attribute Details

#channel_idObject

Returns the value of attribute channel_id.



5
6
7
# File 'lib/frequencyio/channel.rb', line 5

def channel_id
  @channel_id
end

#tokenObject

Returns the value of attribute token.



5
6
7
# File 'lib/frequencyio/channel.rb', line 5

def token
  @token
end

Instance Method Details

#event(message) ⇒ Object

Sends an event to the current channel



15
16
17
# File 'lib/frequencyio/channel.rb', line 15

def event(message)
  Freqnecyio.event(@channel_id, @token, message)
end