Module: ChainOfResponsibility

Defined in:
lib/chain_of_responsibility.rb,
lib/chain_of_responsibility/handler.rb,
lib/chain_of_responsibility/version.rb,
lib/chain_of_responsibility/missing_successor.rb,
lib/chain_of_responsibility/errors/method_not_implemented_error.rb,
lib/chain_of_responsibility/errors/no_appropriate_handler_found_error.rb

Defined Under Namespace

Modules: ClassMethods Classes: Handler, MissingSuccessor

Constant Summary collapse

VERSION =
"0.1.0"
MethodNotImplementedError =
Class.new(StandardError)
NoAppropriateHandlerFoundError =
Class.new(StandardError)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
# File 'lib/chain_of_responsibility.rb', line 6

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#chainObject



20
21
22
# File 'lib/chain_of_responsibility.rb', line 20

def chain
  build_chain(self.class.handlers)
end