Sha256: 9c906f9c01b0e05615e278a7c27df636ca160e13fe9d9e749745c60034e858cc

Contents?: true

Size: 393 Bytes

Versions: 22

Compression:

Stored size: 393 Bytes

Contents

module Bourdain
  module Helpers
    class Locals
      def initialize locals
        locals.each do |name, value|
          instance_variable_set "@#{name}", value
          metaclass = class << self ; self ; end
          metaclass.send(:define_method, name) do
            instance_variable_get("@#{name}")
          end
        end
      end

      def bind ; binding end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
bourdain-1.6.3 lib/bourdain/helpers/locals.rb
bourdain-1.6.2 lib/bourdain/helpers/locals.rb
bourdain-1.6.1 lib/bourdain/helpers/locals.rb
bourdain-1.6.0 lib/bourdain/helpers/locals.rb
bourdain-1.5.1 lib/bourdain/helpers/locals.rb
bourdain-1.5.0 lib/bourdain/helpers/locals.rb
bourdain-1.4.1 lib/bourdain/helpers/locals.rb
bourdain-1.4.0 lib/bourdain/helpers/locals.rb
bourdain-1.3.3 lib/bourdain/helpers/locals.rb
bourdain-1.3.2 lib/bourdain/helpers/locals.rb
bourdain-1.3.1 lib/bourdain/helpers/locals.rb
bourdain-1.3.0 lib/bourdain/helpers/locals.rb
bourdain-1.2.22 lib/bourdain/helpers/locals.rb
bourdain-1.2.21 lib/bourdain/helpers/locals.rb
bourdain-1.2.20 lib/bourdain/helpers/locals.rb
bourdain-1.2.19 lib/bourdain/helpers/locals.rb
bourdain-1.2.18 lib/bourdain/helpers/locals.rb
bourdain-1.2.17 lib/bourdain/helpers/locals.rb
bourdain-1.2.16 lib/bourdain/helpers/locals.rb
bourdain-1.2.15 lib/bourdain/helpers/locals.rb