Class: Jisota::FileScript
- Inherits:
-
Object
- Object
- Jisota::FileScript
- Defined in:
- lib/jisota/file_script.rb
Overview
Part of the Script duck type
Uploads a file on execution
Defined Under Namespace
Instance Attribute Summary collapse
-
#create ⇒ Object
Returns the value of attribute create.
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
-
#update ⇒ Object
Returns the value of attribute update.
Instance Method Summary collapse
- #execute(context) ⇒ Object
-
#initialize(from:, to:, create: true, update: true, &block) ⇒ FileScript
constructor
A new instance of FileScript.
Constructor Details
#initialize(from:, to:, create: true, update: true, &block) ⇒ FileScript
Returns a new instance of FileScript.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jisota/file_script.rb', line 11 def initialize(from: , to: , create: true, update: true, &block) @from = from @to = to @create = create @update = update if block_given? dsl = DSL.new(self) dsl.evaluate(&block) end end |
Instance Attribute Details
#create ⇒ Object
Returns the value of attribute create.
9 10 11 |
# File 'lib/jisota/file_script.rb', line 9 def create @create end |
#from ⇒ Object
Returns the value of attribute from.
9 10 11 |
# File 'lib/jisota/file_script.rb', line 9 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
9 10 11 |
# File 'lib/jisota/file_script.rb', line 9 def to @to end |
#update ⇒ Object
Returns the value of attribute update.
9 10 11 |
# File 'lib/jisota/file_script.rb', line 9 def update @update end |
Instance Method Details
#execute(context) ⇒ Object
22 23 24 |
# File 'lib/jisota/file_script.rb', line 22 def execute(context) Executor.new(script: self, context: context).run end |