module SlackTrello::SlackHelpers::TextParser

Public Instance Methods

args() click to toggle source
# File lib/slack_trello/slack_helpers/text_parser.rb, line 3
def args
  return "" unless valid_text_format?
  matched_text[1].strip.split(" ")
end
matched_text() click to toggle source
# File lib/slack_trello/slack_helpers/text_parser.rb, line 25
def matched_text
  text.match(regex)
end
num_args() click to toggle source
# File lib/slack_trello/slack_helpers/text_parser.rb, line 17
def num_args
  args.length
end
regex() click to toggle source
# File lib/slack_trello/slack_helpers/text_parser.rb, line 21
def regex
  /\((.+?)\)(.+)?/
end
text() click to toggle source
# File lib/slack_trello/slack_helpers/text_parser.rb, line 29
def text
  slack_post_response.text
end
text_message() click to toggle source
# File lib/slack_trello/slack_helpers/text_parser.rb, line 8
def text_message
  return "" unless valid_text_format?
  matched_text[2].strip
end
valid_text_format?() click to toggle source
# File lib/slack_trello/slack_helpers/text_parser.rb, line 13
def valid_text_format?
  !!matched_text
end