class Bearychat::Incoming
Constants
- DEFAULT_PARAMS
Attributes
http_client[R]
Public Class Methods
new(hook, info={})
click to toggle source
Calls superclass method
# File lib/bearychat/incoming.rb, line 17 def initialize(hook, info={}) @http_client = HttpClient.new(hook) super(DEFAULT_PARAMS.merge(info)) end
Public Instance Methods
reset(info)
click to toggle source
# File lib/bearychat/incoming.rb, line 22 def reset(info) info.each { |key, value| self[key] = value } self end
send(body = {}) { |self| ... }
click to toggle source
# File lib/bearychat/incoming.rb, line 27 def send(body = {}) if block_given? yield self send() elsif !body.empty? http_client.post_json(body.to_json) else http_client.post_json(as_json) end end
switch(channel)
click to toggle source
# File lib/bearychat/incoming.rb, line 38 def switch(channel) self.channel = channel self end
Private Instance Methods
as_json()
click to toggle source
# File lib/bearychat/incoming.rb, line 44 def as_json to_h.to_json end