Class: Procedo::Engine::Set

Inherits:
Object
  • Object
show all
Defined in:
lib/procedo/engine/set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(intervention, parameter, list = nil) ⇒ Set

Returns a new instance of Set.


11
12
13
14
15
16
17
# File 'lib/procedo/engine/set.rb', line 11

def initialize(intervention, parameter, list = nil)
  raise 'Invalid intervention' unless intervention.is_a?(Procedo::Engine::Intervention)
  @intervention = intervention
  raise 'Invalid parameter reference' unless parameter.is_a?(Procedo::Procedure::Parameter)
  @parameter = parameter
  @list = list || @intervention.parameters_of_name(@parameter.name)
end

Instance Attribute Details

#parameterObject (readonly)

Returns the value of attribute parameter


6
7
8
# File 'lib/procedo/engine/set.rb', line 6

def parameter
  @parameter
end

Instance Method Details

#build(list = nil) ⇒ Object


23
24
25
# File 'lib/procedo/engine/set.rb', line 23

def build(list = nil)
  self.class.new(@intervention, @parameter, list)
end

#parametersObject


19
20
21
# File 'lib/procedo/engine/set.rb', line 19

def parameters
  @list
end