Class: Flagdoc::Parser
- Inherits:
-
Object
- Object
- Flagdoc::Parser
- Defined in:
- lib/flagdoc/parser.rb
Overview
Constant Summary collapse
- SPLIT_ORDER =
{ 'path' => 0, 'line' => 1 }.freeze
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(string:) ⇒ Parser
constructor
A new instance of Parser.
- #priority ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(string:) ⇒ Parser
Returns a new instance of Parser.
10 11 12 |
# File 'lib/flagdoc/parser.rb', line 10 def initialize(string:) @string = string end |
Instance Method Details
#description ⇒ Object
40 41 42 |
# File 'lib/flagdoc/parser.rb', line 40 def description splitted[2].split(']').last.strip end |
#priority ⇒ Object
32 33 34 35 36 37 |
# File 'lib/flagdoc/parser.rb', line 32 def priority return 'NORMAL' unless type_and_priority.count > 1 priority = type_and_priority.last.strip Priority.available?(priority) ? priority : 'NORMAL' end |
#type ⇒ Object
22 23 24 |
# File 'lib/flagdoc/parser.rb', line 22 SPLIT_ORDER.each do |type, order| define_method(type.to_s) { splitted[order] } end |