Class: Lita::Commands::TwoFactorOff

Inherits:
Object
  • Object
show all
Defined in:
lib/lita/commands/two_factor_off.rb

Instance Method Summary collapse

Constructor Details

#initialize(ou_path = "/") ⇒ TwoFactorOff

Returns a new instance of TwoFactorOff.



6
7
8
# File 'lib/lita/commands/two_factor_off.rb', line 6

def initialize(ou_path = "/")
  @ou_path = ou_path
end

Instance Method Details

#nameObject



10
11
12
# File 'lib/lita/commands/two_factor_off.rb', line 10

def name
  'two-factor-off'
end

#run(robot, target, gateway, opts = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/lita/commands/two_factor_off.rb', line 14

def run(robot, target, gateway, opts = {})
  msg = build_msg(gateway)
  robot.send_message(target, msg) if msg
  if msg.nil? && opts[:negative_ack]
    robot.send_message(target, "All users in #{@ou_path} have Two Factor Authentication enabled")
  end
end