Class: Jisota::FileScript

Inherits:
Object
  • Object
show all
Defined in:
lib/jisota/file_script.rb

Overview

Part of the Script duck type

Uploads a file on execution

Defined Under Namespace

Classes: DSL, Executor

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#createObject

Returns the value of attribute create.



9
10
11
# File 'lib/jisota/file_script.rb', line 9

def create
  @create
end

#fromObject

Returns the value of attribute from.



9
10
11
# File 'lib/jisota/file_script.rb', line 9

def from
  @from
end

#toObject

Returns the value of attribute to.



9
10
11
# File 'lib/jisota/file_script.rb', line 9

def to
  @to
end

#updateObject

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