class SlackTrello::Commands::Work

Attributes

slack_post_response[R]
webhook_url[R]

Public Class Methods

new(slack_post_args, webhook_url) click to toggle source
# 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

Public Instance Methods

run() click to toggle source
# 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

Private Instance Methods

card_desc() click to toggle source
# File lib/slack_trello/commands/work.rb, line 48
  def card_desc
%q{Value Proposition
------------

As a **<type of user>**, I want **<some goal>** so that **<some reason>**.


------------------

Acceptance Criteria
--------------------

I will consider value delivered when **<describe here in plain language> AND the Acceptance Criteria Checklist below has been met**.

---------------

*** << Link to Product Card (if appropriate) >>> ***

---------------

*** <<< Link to Any Epic Cards (if appropriate) >>> ***

---------------

*** <<< ATTACH ANY SUPPORT DOCUMENTS AND INFORMATION HERE >>> ***}
  end
card_title() click to toggle source
# File lib/slack_trello/commands/work.rb, line 44
def card_title
  "(UNSIZED) #{slack_post_response.text.strip} {tag???}"
end
trello_board_name() click to toggle source
# File lib/slack_trello/commands/work.rb, line 36
def trello_board_name
  "#{slack_post_response.channel_name.titleize} Backlog"
end
trello_card() click to toggle source
# File lib/slack_trello/commands/work.rb, line 32
def trello_card
  @card ||= trello_card_creator.first_or_create
end
trello_card_creator() click to toggle source
# File lib/slack_trello/commands/work.rb, line 22
def trello_card_creator
  args = {
    board_name: trello_board_name,
    list_name: trello_list_name,
    card_name: card_title,
    card_desc: card_desc
  }
  @trello_card_creator ||= SlackTrello::TrelloHelpers::CreateCard.new(args)
end
trello_list_name() click to toggle source
# File lib/slack_trello/commands/work.rb, line 40
def trello_list_name
  'From Chat'
end