Class: Decouplio::Steps::Octo

Inherits:
BaseStep
  • Object
show all
Defined in:
lib/decouplio/steps/octo.rb

Instance Attribute Summary collapse

Attributes inherited from BaseStep

#name

Instance Method Summary collapse

Constructor Details

#initialize(name:, ctx_key:, method:) ⇒ Octo

Returns a new instance of Octo.



10
11
12
13
14
15
# File 'lib/decouplio/steps/octo.rb', line 10

def initialize(name:, ctx_key:, method:)
  super()
  @name = name
  @ctx_key = ctx_key
  @method = method
end

Instance Attribute Details

#hash_caseObject

Returns the value of attribute hash_case.



8
9
10
# File 'lib/decouplio/steps/octo.rb', line 8

def hash_case
  @hash_case
end

Instance Method Details

#process(instance:) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/decouplio/steps/octo.rb', line 17

def process(instance:)
  instance.append_railway_flow(@name)
  if @method
    instance.send(@method, **instance.ctx)
  else
    instance[@ctx_key]
  end
end