Class: WriteTask
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
-
#executable ⇒ Object
readonly
Returns the value of attribute executable.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #generate(context_binding) ⇒ Object
-
#initialize(name, contents, executable = false) ⇒ WriteTask
constructor
A new instance of WriteTask.
- #output_name ⇒ Object
Methods included from TaskInterface
Constructor Details
#initialize(name, contents, executable = false) ⇒ WriteTask
Returns a new instance of WriteTask.
87 88 89 90 91 92 |
# File 'lib/task.rb', line 87 def initialize(name, contents, executable = false) raise ArgumentError, "name and contents must be given" if name.nil? || contents.nil? @name = name @contents = contents @executable = executable end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
85 86 87 |
# File 'lib/task.rb', line 85 def contents @contents end |
#executable ⇒ Object (readonly)
Returns the value of attribute executable.
85 86 87 |
# File 'lib/task.rb', line 85 def executable @executable end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
85 86 87 |
# File 'lib/task.rb', line 85 def name @name end |
Instance Method Details
#generate(context_binding) ⇒ Object
94 95 96 |
# File 'lib/task.rb', line 94 def generate(context_binding) @contents end |
#output_name ⇒ Object
98 99 100 |
# File 'lib/task.rb', line 98 def output_name @name end |