Class: Worque::Command::Push::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/worque/command/push/action.rb

Constant Summary collapse

REPORT_FILE_PATH_FORMAT =
"%<worque_path>s/notes-%<date_for>s.md".freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Action

Returns a new instance of Action.



11
12
13
# File 'lib/worque/command/push/action.rb', line 11

def initialize(options)
  @options = options
end

Class Method Details

.run(options) ⇒ Object



21
22
23
24
25
# File 'lib/worque/command/push/action.rb', line 21

def run(options)
  require 'worque/command/push/options'

  new(Worque::Command::Push::Options.new(options)).call()
end

Instance Method Details

#callObject



15
16
17
18
# File 'lib/worque/command/push/action.rb', line 15

def call
  slack = Worque::Utils::Slack.new(options.token)
  JSON.dump(slack.post(options.channel, report_file_content))
end