lib/sing.rb in nicefn-0.1.0 vs lib/sing.rb in nicefn-0.1.1

- old
+ new

@@ -1,8 +1,17 @@ -module Nicefn::Sing - extend self - define_method(:included) {|klass| - klass.extend klass - define_method(:fn) {|func, &blk| define_method(func, &blk) } - define_method(:fp) {|func, &blk| define_method(func, &blk); private func } - } +# Place the Sing module inside of a namespace +module Nicefn + # Add one-liner singleton method/fn declaration capabilities for a module + module Sing + extend self + define_method(:included) do |klass| + klass.extend klass + + define_method(:fn) { |func, &blk| define_method(func, &blk) } + + define_method(:fp) do |func, &blk| + define_method(func, &blk) + private func + end + end + end end