Sha256: 8862405fc8b833ae11e562d5e0f80921c2c4a2e114d60164f6dbdc0619a8f791

Contents?: true

Size: 359 Bytes

Versions: 39

Compression:

Stored size: 359 Bytes

Contents

require 'forward_to'

module ForwardTo
  def forward_self_to(target, *methods)
    for method in Array(methods).flatten
      if method =~ /=$/
        class_eval("def self.#{method}(*args) #{target}.#{method}(*args) end")
      else
        class_eval("def self.#{method}(*args, &block) #{target}.#{method}(*args, &block) end")
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
shellopts-2.5.1 lib/shellopts/ext/forward_to.rb
shellopts-2.5.0 lib/shellopts/ext/forward_to.rb
shellopts-2.4.3 lib/shellopts/ext/forward_to.rb
shellopts-2.4.2 lib/shellopts/ext/forward_to.rb
shellopts-2.4.1 lib/shellopts/ext/forward_to.rb
shellopts-2.4.0 lib/shellopts/ext/forward_to.rb
shellopts-2.3.1 lib/shellopts/ext/forward_to.rb
shellopts-2.3.0 lib/shellopts/ext/forward_to.rb
shellopts-2.2.0 lib/shellopts/ext/forward_to.rb
shellopts-2.1.4 lib/ext/forward_to.rb
shellopts-2.1.3 lib/ext/forward_to.rb
shellopts-2.1.2 lib/ext/forward_to.rb
shellopts-2.1.1 lib/ext/forward_to.rb
shellopts-2.1.0 lib/ext/forward_to.rb
shellopts-2.0.24 lib/ext/forward_to.rb
shellopts-2.0.23 lib/ext/forward_to.rb
shellopts-2.0.22 lib/ext/forward_to.rb
shellopts-2.0.21 lib/ext/forward_to.rb
shellopts-2.0.20 lib/ext/forward_to.rb
shellopts-2.0.19 lib/ext/forward_to.rb