Method: CabbageDoc::Example#parse

Defined in:
lib/cabbage_doc/example.rb

#parse(text, tag = TAG) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/cabbage_doc/example.rb', line 13

def parse(text, tag = TAG)
  m = text.match(/^(.*?)\s+-\s+(\(.*?\))$/)
  return false unless m

  @label = m[1].strip
  @params = parse_option(m[2].strip)

  valid?
end