Class: Docdown::CodeCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/docdown/code_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arg) ⇒ CodeCommand



8
9
10
# File 'lib/docdown/code_command.rb', line 8

def initialize(arg)

end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



3
4
5
# File 'lib/docdown/code_command.rb', line 3

def command
  @command
end

#contentsObject

Returns the value of attribute contents.



3
4
5
# File 'lib/docdown/code_command.rb', line 3

def contents
  @contents
end

#hiddenObject Also known as: hidden?

Returns the value of attribute hidden.



3
4
5
# File 'lib/docdown/code_command.rb', line 3

def hidden
  @hidden
end

#keywordObject

Returns the value of attribute keyword.



3
4
5
# File 'lib/docdown/code_command.rb', line 3

def keyword
  @keyword
end

#render_resultObject 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

#callObject

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

#renderObject

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