Class: SlackTrello::Commands::CreateCard
- Inherits:
-
Object
- Object
- SlackTrello::Commands::CreateCard
- Includes:
- StandardStuff, SlackHelpers::TextParser
- Defined in:
- lib/slack_trello/commands/create_card.rb
Instance Attribute Summary collapse
-
#slack_post_response ⇒ Object
readonly
Returns the value of attribute slack_post_response.
-
#webhook_url ⇒ Object
readonly
Returns the value of attribute webhook_url.
Instance Method Summary collapse
-
#initialize(slack_post_args, webhook_url) ⇒ CreateCard
constructor
A new instance of CreateCard.
- #run ⇒ Object
Methods included from SlackHelpers::TextParser
#args, #matched_text, #num_args, #regex, #text, #text_message, #valid_text_format?
Methods included from StandardStuff
#help_message, #list_not_found_message, #speaker, #success_message
Constructor Details
#initialize(slack_post_args, webhook_url) ⇒ CreateCard
Returns a new instance of CreateCard.
8 9 10 11 |
# File 'lib/slack_trello/commands/create_card.rb', line 8 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_response ⇒ Object (readonly)
Returns the value of attribute slack_post_response.
6 7 8 |
# File 'lib/slack_trello/commands/create_card.rb', line 6 def slack_post_response @slack_post_response end |
#webhook_url ⇒ Object (readonly)
Returns the value of attribute webhook_url.
6 7 8 |
# File 'lib/slack_trello/commands/create_card.rb', line 6 def webhook_url @webhook_url end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/slack_trello/commands/create_card.rb', line 13 def run return unless valid_text_format? return unless num_args == 2 return unless trello_card_creator.trello_list trello_card speaker.speak "You should see a notification with a link. If not, the card might not have been created." end |