Class: Yome::Section
- Inherits:
-
Object
- Object
- Yome::Section
- Defined in:
- lib/yome/section.rb
Instance Attribute Summary collapse
-
#section ⇒ Object
readonly
Returns the value of attribute section.
Instance Method Summary collapse
- #add_text(chip) ⇒ Object
-
#initialize(chip) ⇒ Section
constructor
A new instance of Section.
- #priority ⇒ Object
- #result(parser, lang) ⇒ Object
Constructor Details
#initialize(chip) ⇒ Section
Returns a new instance of Section.
5 6 7 8 |
# File 'lib/yome/section.rb', line 5 def initialize(chip) @section = chip @texts = [] end |
Instance Attribute Details
#section ⇒ Object (readonly)
Returns the value of attribute section.
3 4 5 |
# File 'lib/yome/section.rb', line 3 def section @section end |
Instance Method Details
#add_text(chip) ⇒ Object
14 15 16 |
# File 'lib/yome/section.rb', line 14 def add_text(chip) @texts << chip end |
#priority ⇒ Object
10 11 12 |
# File 'lib/yome/section.rb', line 10 def priority @section.priority end |
#result(parser, lang) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/yome/section.rb', line 18 def result(parser, lang) <<EOS ## #{@section.content} *#{@section.path}* #{src_code(parser, @section, false, lang)} #{@texts.map { |e| src_code(parser, e, true, lang) }.join("\n")} EOS end |