Class: Ledmon::Monster::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/ledmon/monster/runner.rb

Defined Under Namespace

Classes: Error, ScriptNotFoundError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:) ⇒ Runner

Returns a new instance of Runner.



11
12
13
14
15
# File 'lib/ledmon/monster/runner.rb', line 11

def initialize(path:)
  @path = path
  @script_path = File.join(path, 'monster.rb')
  @executor = Executor.new(mode:)
end

Instance Attribute Details

#executorObject (readonly)

Returns the value of attribute executor.



9
10
11
# File 'lib/ledmon/monster/runner.rb', line 9

def executor
  @executor
end

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/ledmon/monster/runner.rb', line 6

def path
  @path
end

#scriptObject (readonly)

Returns the value of attribute script.



8
9
10
# File 'lib/ledmon/monster/runner.rb', line 8

def script
  @script
end

#script_pathObject (readonly)

Returns the value of attribute script_path.



7
8
9
# File 'lib/ledmon/monster/runner.rb', line 7

def script_path
  @script_path
end

Instance Method Details

#run!Object



17
18
19
20
21
# File 'lib/ledmon/monster/runner.rb', line 17

def run!
  load_script!
  setup!
  execute!
end