Class: Object

Inherits:
BasicObject
Defined in:
lib/bakery/detail/global_function.rb

Overview

Copyright © 2013 Nathan Currier

Use, modification, and distribution are all subject to the Boost Software License, Version 1.0. (See the accompanying file LICENSE.md or at rideliner.tk/LICENSE.html).

<description>

Instance Method Summary collapse

Instance Method Details

#global_function(name, &block) ⇒ Object



13
14
15
16
17
# File 'lib/bakery/detail/global_function.rb', line 13

def global_function name, &block
  Bakery::Log.debug "create global function: #{name.to_s}"

  self.class.send :define_method, name, &block
end