Class: SlackTrello::TextParser

Inherits:
Object
  • Object
show all
Defined in:
lib/slack_trello/text_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, options = {}) ⇒ TextParser



5
6
7
8
# File 'lib/slack_trello/text_parser.rb', line 5

def initialize(text, options = {})
  @text = text
  @required_arguments = options.fetch(:required_arguments, nil)
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



3
4
5
# File 'lib/slack_trello/text_parser.rb', line 3

def text
  @text
end

Instance Method Details

#argsObject



10
11
12
# File 'lib/slack_trello/text_parser.rb', line 10

def args
  matched_text[1].strip.split(" ")
end

#text_messageObject



14
15
16
# File 'lib/slack_trello/text_parser.rb', line 14

def text_message
  matched_text[2].strip
end

#valid_text_format?Boolean



18
19
20
# File 'lib/slack_trello/text_parser.rb', line 18

def valid_text_format?
  !!matched_text
end