Module: Pathway::Plugins::Base::ClassMethods

Defined in:
lib/pathway.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#result_keyObject

Returns the value of attribute result_key.



112
113
114
# File 'lib/pathway.rb', line 112

def result_key
  @result_key
end

Instance Method Details

#inherited(subclass) ⇒ Object



128
129
130
131
# File 'lib/pathway.rb', line 128

def inherited(subclass)
  super
  subclass.result_key = result_key
end

#process(&bl) ⇒ Object



115
116
117
118
119
120
121
122
# File 'lib/pathway.rb', line 115

def process(&bl)
  dsl = self::DSL
  define_method(:call) do |input|
    dsl.new(State.new(self, input: input), self)
       .run(&bl)
       .then(&:result)
  end
end