Module: Nanoboy::Hook::SymbolHook

Defined in:
lib/nanoboy/hook.rb

Overview

This is the module that allows the sugared syntax: :ClassToExtend.include!

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/nanoboy/hook.rb', line 36

def self.included(klass)
  klass.class_eval do
    Nanoboy.methods.each do |method|
      define_method "#{method}!" do |extension|
        Nanoboy.send("#{method}!", self, extension)
      end
    end
  end
end