Sha256: 796c1327fc8b9a965fcfc3be03a416a0f70262a467487a26e06e25fa5a159d66

Contents?: true

Size: 546 Bytes

Versions: 8

Compression:

Stored size: 546 Bytes

Contents

require 'ludy/kernel/public_send' unless RUBY_VERSION < '1.9.0'
require 'ludy/class/undef_all_methods'

module Ludy

  # a variable reference, used for side effect...
  class Variable
    undef_all_methods

    # init the refered instance
    def initialize obj
      @__obj__ = obj
    end

    # delegator
    def method_missing msg, *arg, &block
      @__obj__.public_send msg, *arg, &block
    end

    attr_accessor :__obj__
  end

  # provided for creating lazy object more convient
  def var arg
    Variable.new arg
  end

end # of Ludy

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ludy-0.1.10 lib/ludy/variable.rb
ludy-0.1.8 lib/ludy/variable.rb
ludy-0.1.3 lib/ludy/variable.rb
ludy-0.1.4 lib/ludy/variable.rb
ludy-0.1.5 lib/ludy/variable.rb
ludy-0.1.6 lib/ludy/variable.rb
ludy-0.1.7 lib/ludy/variable.rb
ludy-0.1.9 lib/ludy/variable.rb