Class: ServiceOperator::Step

Inherits:
Struct
  • Object
show all
Defined in:
lib/service_operator/step.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



4
5
6
# File 'lib/service_operator/step.rb', line 4

def args
  @args
end

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



4
5
6
# File 'lib/service_operator/step.rb', line 4

def block
  @block
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/service_operator/step.rb', line 4

def name
  @name
end

#serviceObject

Returns the value of attribute service

Returns:

  • (Object)

    the current value of service



4
5
6
# File 'lib/service_operator/step.rb', line 4

def service
  @service
end

Instance Method Details

#run(operator:, proc: nil) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/service_operator/step.rb', line 5

def run(operator:, proc: nil)
  @operator = operator

  return instance_exec(proc || @operator, &block) if block
  return perform_service_step if service

  perform_method_step(proc)
end