Class: SlackMessaging::Send

Inherits:
Object
  • Object
show all
Defined in:
lib/slack_messaging/send.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.optionsObject

Returns the value of attribute options.



6
7
8
# File 'lib/slack_messaging/send.rb', line 6

def options
  @options
end

Class Method Details

.execute(args, options) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/slack_messaging/send.rb', line 8

def execute(args, options)
  if args.empty?
    message = SlackMessaging::RandomMessage.acquire_random_quote
    distribute_notification(message, options[:service])
  else
    args.each do |arg_message|
      distribute_notification(arg_message, options[:service])
    end
  end
end