Class: Object

Inherits:
BasicObject
Includes:
Full, Spruz::Attempt, Spruz::DeepDup, Spruz::P
Defined in:
lib/spruz/xt/p.rb,
lib/spruz/xt/full.rb,
lib/spruz/xt/named.rb,
lib/spruz/xt/attempt.rb,
lib/spruz/xt/deep_dup.rb

Instance Method Summary collapse

Methods included from Spruz::DeepDup

#deep_dup

Methods included from Spruz::Attempt

#attempt

Instance Method Details

#named(name, method, *args, &block) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/spruz/xt/named.rb', line 5

def named(name, method, *args, &named_block)
  extend Module.new {
    define_method(name) do |*rest, &block|
      block = named_block if named_block
      __send__(method, *(args + rest), &block)
    end
  }
end