Class: Bashly::Models::Script
- Inherits:
-
Object
- Object
- Bashly::Models::Script
- Includes:
- Renderable
- Defined in:
- lib/bashly/models/script.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#function_name ⇒ Object
readonly
Returns the value of attribute function_name.
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(command, function_name = nil) ⇒ Script
constructor
A new instance of Script.
Methods included from Renderable
Constructor Details
#initialize(command, function_name = nil) ⇒ Script
Returns a new instance of Script.
8 9 10 |
# File 'lib/bashly/models/script.rb', line 8 def initialize(command, function_name = nil) @command, @function_name = command, function_name end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
6 7 8 |
# File 'lib/bashly/models/script.rb', line 6 def command @command end |
#function_name ⇒ Object (readonly)
Returns the value of attribute function_name.
6 7 8 |
# File 'lib/bashly/models/script.rb', line 6 def function_name @function_name end |
Instance Method Details
#code ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/bashly/models/script.rb', line 12 def code if function_name result = [header, render('wrapper')].join "\n" else result = [header, body].join "\n" end result.lint end |