Class: SlackTrello::Commands::Work

Inherits:
Object
  • Object
show all
Includes:
StandardStuff
Defined in:
lib/slack_trello/commands/work.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from StandardStuff

#help_message, #list_not_found_message, #speaker, #success_message

Constructor Details

#initialize(slack_post_args, webhook_url) ⇒ Work

Returns a new instance of Work.



7
8
9
10
# File 'lib/slack_trello/commands/work.rb', line 7

def initialize(slack_post_args, webhook_url)
  @slack_post_response = OpenStruct.new(slack_post_args)
  @webhook_url = webhook_url
end

Instance Attribute Details

#slack_post_responseObject (readonly)

Returns the value of attribute slack_post_response.



5
6
7
# File 'lib/slack_trello/commands/work.rb', line 5

def slack_post_response
  @slack_post_response
end

#webhook_urlObject (readonly)

Returns the value of attribute webhook_url.



5
6
7
# File 'lib/slack_trello/commands/work.rb', line 5

def webhook_url
  @webhook_url
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
# File 'lib/slack_trello/commands/work.rb', line 12

def run
  return list_not_found_message unless trello_card_creator.trello_list

  trello_card
  speaker.speak success_message
  "You should see a notification with a link. If not, the card might not have been created."
end