Class: Ping::Parser
- Inherits:
-
Object
- Object
- Ping::Parser
- Defined in:
- lib/ping/parser.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text = nil) ⇒ Parser
constructor
A new instance of Parser.
- #issue_references ⇒ Object
- #mentions ⇒ Object
- #replace_issue_references(&block) ⇒ Object
Constructor Details
#initialize(text = nil) ⇒ Parser
Returns a new instance of Parser.
11 12 13 |
# File 'lib/ping/parser.rb', line 11 def initialize(text = nil) @text = text.to_s end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
9 10 11 |
# File 'lib/ping/parser.rb', line 9 def text @text end |
Instance Method Details
#issue_references ⇒ Object
19 20 21 |
# File 'lib/ping/parser.rb', line 19 def issue_references Ping::IssueReference.extract(text) end |
#mentions ⇒ Object
15 16 17 |
# File 'lib/ping/parser.rb', line 15 def mentions Ping::Mention.extract(text) end |
#replace_issue_references(&block) ⇒ Object
23 24 25 |
# File 'lib/ping/parser.rb', line 23 def replace_issue_references(&block) Ping::IssueReference.replace(text, &block) end |