Class: Blabber::Campfire
- Inherits:
-
Object
- Object
- Blabber::Campfire
- Includes:
- Channel
- Defined in:
- lib/blabber/campfire.rb
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Campfire
constructor
A new instance of Campfire.
- #loglevels ⇒ Object
- #speak(message, loglevel, opts) ⇒ Object
Constructor Details
#initialize(opts) ⇒ Campfire
Returns a new instance of Campfire.
12 13 14 15 16 17 18 19 20 |
# File 'lib/blabber/campfire.rb', line 12 def initialize(opts) @opts = opts Broach.settings = @opts.keys.inject({'use_ssl' => true}) do |acc, key| if(['account', 'token'].include?(key)) acc[key] = @opts[key] end acc end end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
8 9 10 |
# File 'lib/blabber/campfire.rb', line 8 def opts @opts end |
Instance Method Details
#loglevels ⇒ Object
22 23 24 |
# File 'lib/blabber/campfire.rb', line 22 def loglevels @opts['loglevels'] end |
#speak(message, loglevel, opts) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/blabber/campfire.rb', line 26 def speak(, loglevel, opts) msg_opts = {} if .gsub(/\n|\r/, "") != msg_opts[:type] = :paste end Broach.speak(@opts['room'], , msg_opts) end |