Class: Pushit::Channel

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

Instance Method Summary collapse

Constructor Details

#initialize(channel_name, options = {}) ⇒ Channel

Returns a new instance of Channel.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/pushit/channel.rb', line 6

def initialize(channel_name, options = {})
    options               = {
      scheme: 'https',
      host:   'ws.slaask.com'
    }.merge(options)

    @channel_name         = channel_name
    @scheme, @host, @port = options.values_at(
      :scheme, :host, :port
    )
end

Instance Method Details

#post(event, data = {}) ⇒ Object



18
19
20
# File 'lib/pushit/channel.rb', line 18

def post(event, data = {})
  Request.new(:post, url(event)).post(data)
end