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.



82
83
84
# File 'lib/pathway.rb', line 82

def result_key
  @result_key
end

Instance Method Details

#inherited(subclass) ⇒ Object



93
94
95
96
# File 'lib/pathway.rb', line 93

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

#process(&bl) ⇒ Object



84
85
86
87
88
89
# File 'lib/pathway.rb', line 84

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