module ChainableMethods

Constants

VERSION

Public Class Methods

included(base) click to toggle source
# File lib/chainable_methods.rb, line 12
def self.included(base)
  base.extend(self)
  begin
    # this way the module doesn't have to declare all methods as class methods
    base.extend(base) if base.kind_of?(Module)
  rescue TypeError
    # wrong argument type Class (expected Module)
  end
end

Public Instance Methods

chain_from(initial_state, context = self) click to toggle source
# File lib/chainable_methods.rb, line 22
def chain_from(initial_state, context = self)
  ChainableMethods::Link.new(initial_state, context)
end