Class: WikiMd::Entry
- Inherits:
-
Object
- Object
- WikiMd::Entry
- Defined in:
- lib/wiki_md.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#footer ⇒ Object
Returns the value of attribute footer.
-
#heading ⇒ Object
readonly
Returns the value of attribute heading.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#x ⇒ Object
Returns the value of attribute x.
Instance Method Summary collapse
-
#initialize(rx, debug: false) ⇒ Entry
constructor
A new instance of Entry.
- #to_s(compact: false) ⇒ Object
Constructor Details
#initialize(rx, debug: false) ⇒ Entry
Returns a new instance of Entry.
22 23 24 25 26 27 28 |
# File 'lib/wiki_md.rb', line 22 def initialize(rx, debug: false) @rx, @debug = rx, debug @x = @rx.x parse_x() end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
20 21 22 |
# File 'lib/wiki_md.rb', line 20 def body @body end |
#footer ⇒ Object
Returns the value of attribute footer.
20 21 22 |
# File 'lib/wiki_md.rb', line 20 def @footer end |
#heading ⇒ Object (readonly)
Returns the value of attribute heading.
20 21 22 |
# File 'lib/wiki_md.rb', line 20 def heading @heading end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
20 21 22 |
# File 'lib/wiki_md.rb', line 20 def @tags end |
#x ⇒ Object
Returns the value of attribute x.
20 21 22 |
# File 'lib/wiki_md.rb', line 20 def x @x end |
Instance Method Details
#to_s(compact: false) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/wiki_md.rb', line 46 def to_s(compact: false) if !compact then @x.clone + "\n\n" else '# ' + @heading + ' #' + @tags.join(' #') + "\n\n" + @body end end |