Sha256: d7484e0eed82753d94e0609330d4021a50752bcd7d014e9c7a7a2976fb1ca48d

Contents?: true

Size: 1.21 KB

Versions: 8

Compression:

Stored size: 1.21 KB

Contents

module Isomorfeus
  module Puppetmaster
    module SelfForwardable
      def self.extended(base)
          base.define_singleton_method(:document_forward) do |methods|
            methods.each do |method|
              define_method(method) do |*args, &block|
                @driver.send("document_#{method}", self, *args, &block)
              end
            end
          end

          base.define_singleton_method(:document_forward_kwargs) do |methods|
            methods.each do |method|
              define_method(method) do |*args, **kwargs, &block|
                @driver.send("document_#{method}", self, *args, **kwargs, &block)
              end
            end
          end

          base.define_singleton_method(:frame_forward) do |methods|
            methods.each do |method|
              define_method(method) do |*args|
                @driver.send("frame_#{method}", self, *args)
              end
            end
          end

          base.define_singleton_method(:node_forward) do |methods|
            methods.each do |method|
              define_method(method) do |*args|
                @driver.send("node_#{method}", self, *args)
              end
            end
          end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
isomorfeus-puppetmaster-0.5.5 lib/isomorfeus/puppetmaster/self_forwardable.rb
isomorfeus-puppetmaster-0.5.4 lib/isomorfeus/puppetmaster/self_forwardable.rb
isomorfeus-puppetmaster-0.5.3 lib/isomorfeus/puppetmaster/self_forwardable.rb
isomorfeus-puppetmaster-0.5.2 lib/isomorfeus/puppetmaster/self_forwardable.rb
isomorfeus-puppetmaster-0.5.1 lib/isomorfeus/puppetmaster/self_forwardable.rb
isomorfeus-puppetmaster-0.5.0 lib/isomorfeus/puppetmaster/self_forwardable.rb
isomorfeus-puppetmaster-0.4.1 lib/isomorfeus/puppetmaster/self_forwardable.rb
isomorfeus-puppetmaster-0.4.0 lib/isomorfeus/puppetmaster/self_forwardable.rb