Sha256: 16a375025966122904af0304f5b2afb07e1cddfdff2ef7f062054d68f50e7a54
Contents?: true
Size: 471 Bytes
Versions: 16
Compression:
Stored size: 471 Bytes
Contents
#http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/150311 require 'ostruct' class ROpenStruct < OpenStruct def method_missing(mid, *args) mname = mid.id2name len = args.length if len == 0 @table[mname.intern] = ROpenStruct.new self.new_ostruct_member(mname) @table[mname.intern] else super end end end test = ROpenStruct.new test.p = "hello" test.t.s.p.t.z.y.x = "hi" test.xyz p test
Version data entries
16 entries across 16 versions & 1 rubygems