Sha256: e43becbe815d6c42658c7b168e5409965f711f7f2131f411e919581671edd6db

Contents?: true

Size: 516 Bytes

Versions: 7

Compression:

Stored size: 516 Bytes

Contents

require 'ludy/kernel/public_send'
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

7 entries across 7 versions & 2 rubygems

Version Path
godfat-ludy-0.1.13 lib/ludy/variable.rb
ludy-0.1.15 lib/ludy/variable.rb
ludy-0.1.1 lib/ludy/variable.rb
ludy-0.1.13 lib/ludy/variable.rb
ludy-0.1.2 lib/ludy/variable.rb
ludy-0.1.11 lib/ludy/variable.rb
ludy-0.1.0 lib/ludy/variable.rb