Class: Blabber::Mock

Inherits:
Object
  • Object
show all
Includes:
Channel
Defined in:
lib/blabber/mock.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Channel

#emit

Constructor Details

#initialize(opts) ⇒ Mock

Returns a new instance of Mock.



10
11
12
# File 'lib/blabber/mock.rb', line 10

def initialize(opts)
  @opts = opts
end

Instance Attribute Details

#optsObject (readonly)

Returns the value of attribute opts.



8
9
10
# File 'lib/blabber/mock.rb', line 8

def opts
  @opts
end

Instance Method Details

#loglevelsObject



14
15
16
# File 'lib/blabber/mock.rb', line 14

def loglevels
  @opts['loglevels']
end

#speak(message, loglevel, opts) ⇒ Object



18
19
20
# File 'lib/blabber/mock.rb', line 18

def speak(message, loglevel, opts)
  @opts['log'].set_data({"message" => message, "loglevel" => loglevel, "opts" => opts})
end