Class: AnnotateRb::ModelAnnotator::FileParser::YmlParser

Inherits:
Object
  • Object
show all
Defined in:
lib/annotate_rb/model_annotator/file_parser/yml_parser.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ YmlParser

Returns a new instance of YmlParser.



17
18
19
20
21
22
# File 'lib/annotate_rb/model_annotator/file_parser/yml_parser.rb', line 17

def initialize(input)
  @input = input
  @comments = []
  @starts = []
  @ends = []
end

Instance Attribute Details

#commentsObject (readonly)

Returns the value of attribute comments.



15
16
17
# File 'lib/annotate_rb/model_annotator/file_parser/yml_parser.rb', line 15

def comments
  @comments
end

#endsObject (readonly)

Returns the value of attribute ends.



15
16
17
# File 'lib/annotate_rb/model_annotator/file_parser/yml_parser.rb', line 15

def ends
  @ends
end

#startsObject (readonly)

Returns the value of attribute starts.



15
16
17
# File 'lib/annotate_rb/model_annotator/file_parser/yml_parser.rb', line 15

def starts
  @starts
end

Class Method Details

.parse(string) ⇒ Object



10
11
12
# File 'lib/annotate_rb/model_annotator/file_parser/yml_parser.rb', line 10

def parse(string)
  _parser = new(string).tap(&:parse)
end

Instance Method Details

#parseObject



24
25
26
27
# File 'lib/annotate_rb/model_annotator/file_parser/yml_parser.rb', line 24

def parse
  parse_comments
  parse_yml
end