Module: ParserUtility

Defined in:
lib/parserutility.rb

Overview

Copyright © garin <[email protected]> 2011 See the included file COPYING for details. -*- encoding: utf-8 -*-

Instance Method Summary collapse

Instance Method Details

#add_children_to_element(obj, *val) ⇒ Object



5
6
7
# File 'lib/parserutility.rb', line 5

def add_children_to_element(obj, *val)
  obj.add = *val
end

#mark_to_level(mark_str) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/parserutility.rb', line 9

def mark_to_level(mark_str)
   mark2level_list = {
    "=" => 1,
    "==" => 2,
    "===" => 3,
    "====" => 4,
    "+" => 5,
    "++" => 6
  }
  mark2level_list[mark_str] or
    raise ArgumentError, "#{mark_str} is irregular for Headline mark."
end