Module: ChainMail::Chainable

Included in:
Axe::API::A11yCheck, Axe::API::Run, Axe::Matchers::BeAxeClean
Defined in:
lib/chain_mail/chainable.rb

Class Method Summary collapse

Class Method Details

.chainable(*methods) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/chain_mail/chainable.rb', line 9

def chainable(*methods)
  methods.each do |method|
    original = instance_method(method)
    define_method method do |*args|
      original.bind(self).call(*args)
      self
    end
  end
end