Sha256: 9eba71a3ad4f37181168c3efc937308079f9c2554a342575ce812f4a8b1c3e55

Contents?: true

Size: 380 Bytes

Versions: 6

Compression:

Stored size: 380 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
      @triggers.merge(names)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
surrounded-0.8.4 lib/surrounded/shortcuts.rb
surrounded-0.8.3 lib/surrounded/shortcuts.rb
surrounded-0.8.2 lib/surrounded/shortcuts.rb
surrounded-0.8.1 lib/surrounded/shortcuts.rb
surrounded-0.8.0 lib/surrounded/shortcuts.rb
surrounded-0.7.3 lib/surrounded/shortcuts.rb