Class: Jkr::Plan

Inherits:
Object
  • Object
show all
Defined in:
lib/jkr/plan.rb

Defined Under Namespace

Classes: PlanLoader

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(jkr_env, plan_file_path = nil) ⇒ Plan

Returns a new instance of Plan.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/jkr/plan.rb', line 24

def initialize(jkr_env, plan_file_path = nil)
  @jkr_env = jkr_env
  @file_path = plan_file_path || jkr_env.next_plan
  return nil unless @file_path

  @title = "no title"
  @desc = "no desc"

  @params = {}
  @vars = {}
  @routine = lambda do |_|
    raise NotImplementedError.new("A routine of experiment '#{@title}' is not implemented")
  end
  @prep = lambda do |_|
    raise NotImplementedError.new("A prep of experiment '#{@title}' is not implemented")
  end
  @cleanup = lambda do |_|
    raise NotImplementedError.new("A cleanup of experiment '#{@title}' is not implemented")
  end

  @src = nil

  PlanLoader.load_plan(self)
end

Instance Attribute Details

#analysisObject

Returns the value of attribute analysis.



17
18
19
# File 'lib/jkr/plan.rb', line 17

def analysis
  @analysis
end

#cleanupObject

Returns the value of attribute cleanup.



15
16
17
# File 'lib/jkr/plan.rb', line 15

def cleanup
  @cleanup
end

#descObject

Returns the value of attribute desc.



8
9
10
# File 'lib/jkr/plan.rb', line 8

def desc
  @desc
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



21
22
23
# File 'lib/jkr/plan.rb', line 21

def file_path
  @file_path
end

#jkr_envObject (readonly)

Returns the value of attribute jkr_env.



22
23
24
# File 'lib/jkr/plan.rb', line 22

def jkr_env
  @jkr_env
end

#paramsObject

Returns the value of attribute params.



10
11
12
# File 'lib/jkr/plan.rb', line 10

def params
  @params
end

#prepObject

Proc’s



14
15
16
# File 'lib/jkr/plan.rb', line 14

def prep
  @prep
end

#routineObject

Returns the value of attribute routine.



16
17
18
# File 'lib/jkr/plan.rb', line 16

def routine
  @routine
end

#srcObject

Returns the value of attribute src.



19
20
21
# File 'lib/jkr/plan.rb', line 19

def src
  @src
end

#titleObject

Returns the value of attribute title.



7
8
9
# File 'lib/jkr/plan.rb', line 7

def title
  @title
end

#varsObject

Returns the value of attribute vars.



11
12
13
# File 'lib/jkr/plan.rb', line 11

def vars
  @vars
end