Class: Quarry::Markup::Header
Overview
Header
Instance Attribute Summary collapse
-
#lineno ⇒ Object
readonly
Returns the value of attribute lineno.
-
#spec ⇒ Object
(also: #parent)
readonly
Returns the value of attribute spec.
-
#text ⇒ Object
(also: #description)
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(spec, text, lineno) ⇒ Header
constructor
A new instance of Header.
-
#run(runner, spec, context, output) ⇒ Object
“run” comment.
- #to_s ⇒ Object
-
#to_script ⇒ Object
As would appear in stand-alone script.
Constructor Details
#initialize(spec, text, lineno) ⇒ Header
Returns a new instance of Header.
13 14 15 16 17 |
# File 'lib/quarry/markup/header.rb', line 13 def initialize(spec, text, lineno) @parent = spec @text = text.strip @lineno = lineno end |
Instance Attribute Details
#lineno ⇒ Object (readonly)
Returns the value of attribute lineno.
11 12 13 |
# File 'lib/quarry/markup/header.rb', line 11 def lineno @lineno end |
#spec ⇒ Object (readonly) Also known as: parent
Returns the value of attribute spec.
9 10 11 |
# File 'lib/quarry/markup/header.rb', line 9 def spec @spec end |
#text ⇒ Object (readonly) Also known as: description
Returns the value of attribute text.
10 11 12 |
# File 'lib/quarry/markup/header.rb', line 10 def text @text end |
Instance Method Details
#run(runner, spec, context, output) ⇒ Object
“run” comment.
23 24 25 |
# File 'lib/quarry/markup/header.rb', line 23 def run(runner, spec, context, output) output.report_header(self) end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/quarry/markup/header.rb', line 28 def to_s text.to_s end |
#to_script ⇒ Object
As would appear in stand-alone script.
33 34 35 |
# File 'lib/quarry/markup/header.rb', line 33 def to_script text.to_s.gsub(/^/m, '# ') end |