Class: Perkins::Build::Shell::Node
- Defined in:
- lib/perkins/build/shell/node.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #escape(code) ⇒ Object
-
#initialize(*args) {|_self| ... } ⇒ Node
constructor
A new instance of Node.
- #name ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
8 9 10 |
# File 'lib/perkins/build/shell/node.rb', line 8 def code @code end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
8 9 10 |
# File 'lib/perkins/build/shell/node.rb', line 8 def level @level end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/perkins/build/shell/node.rb', line 8 def @options end |
Instance Method Details
#escape(code) ⇒ Object
25 26 27 |
# File 'lib/perkins/build/shell/node.rb', line 25 def escape(code) Shellwords.escape(code) end |
#name ⇒ Object
17 18 19 |
# File 'lib/perkins/build/shell/node.rb', line 17 def name self.class.name.split('::').last.downcase end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/perkins/build/shell/node.rb', line 21 def to_s code ? code.indent(level) : code end |