Sha256: 834ff3b545cfbc4b8a1c8e3f1104a04b05f2d2b7ff0be8e049b68f221700b703

Contents?: true

Size: 358 Bytes

Versions: 10

Compression:

Stored size: 358 Bytes

Contents

module Surrounded
  module Shortcuts
    private
    
    def define_shortcut(name)
      singleton_class.send(:define_method, name) do |*args|
        instance = self.new(*args)
        instance.public_send(name)
      end
    end
    def store_trigger(*names)
      names.each do |name|
        define_shortcut(name)
      end
      super
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
surrounded-0.9.9 lib/surrounded/shortcuts.rb
surrounded-0.9.8 lib/surrounded/shortcuts.rb
surrounded-0.9.7 lib/surrounded/shortcuts.rb
surrounded-0.9.6 lib/surrounded/shortcuts.rb
surrounded-0.9.5 lib/surrounded/shortcuts.rb
surrounded-0.9.4 lib/surrounded/shortcuts.rb
surrounded-0.9.3 lib/surrounded/shortcuts.rb
surrounded-0.9.2 lib/surrounded/shortcuts.rb
surrounded-0.9.1 lib/surrounded/shortcuts.rb
surrounded-0.9.0 lib/surrounded/shortcuts.rb