Class: Docdown::CodeCommand
- Inherits:
-
Object
- Object
- Docdown::CodeCommand
- Defined in:
- lib/docdown/code_command.rb
Direct Known Subclasses
Docdown::CodeCommands::Bash, Docdown::CodeCommands::NoSuchCommand, Docdown::CodeCommands::Repl, Docdown::CodeCommands::Write
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#hidden ⇒ Object
(also: #hidden?)
Returns the value of attribute hidden.
-
#keyword ⇒ Object
Returns the value of attribute keyword.
-
#render_result ⇒ Object
(also: #render_result?)
Returns the value of attribute render_result.
Instance Method Summary collapse
-
#call ⇒ Object
executes command to build project.
-
#initialize(arg) ⇒ CodeCommand
constructor
A new instance of CodeCommand.
- #push(contents) ⇒ Object (also: #<<)
-
#render ⇒ Object
returns the markedup command do not over-write unless you call super.
Constructor Details
#initialize(arg) ⇒ CodeCommand
8 9 10 |
# File 'lib/docdown/code_command.rb', line 8 def initialize(arg) end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
3 4 5 |
# File 'lib/docdown/code_command.rb', line 3 def command @command end |
#contents ⇒ Object
Returns the value of attribute contents.
3 4 5 |
# File 'lib/docdown/code_command.rb', line 3 def contents @contents end |
#hidden ⇒ Object Also known as:
Returns the value of attribute hidden.
3 4 5 |
# File 'lib/docdown/code_command.rb', line 3 def hidden @hidden end |
#keyword ⇒ Object
Returns the value of attribute keyword.
3 4 5 |
# File 'lib/docdown/code_command.rb', line 3 def keyword @keyword end |
#render_result ⇒ Object Also known as: render_result?
Returns the value of attribute render_result.
3 4 5 |
# File 'lib/docdown/code_command.rb', line 3 def render_result @render_result end |
Instance Method Details
#call ⇒ Object
executes command to build project
28 29 30 |
# File 'lib/docdown/code_command.rb', line 28 def call raise "not implemented" end |
#push(contents) ⇒ Object Also known as: <<
21 22 23 24 |
# File 'lib/docdown/code_command.rb', line 21 def push(contents) @contents ||= "" @contents << contents end |
#render ⇒ Object
returns the markedup command do not over-write unless you call super
14 15 16 17 18 19 |
# File 'lib/docdown/code_command.rb', line 14 def render result = self.call return [to_md, result].join("\n") if render_result? return "" if hidden? to_md end |