method
method_missing
method_missing(mid, *args)
public
Hide source
# File lib/ostruct.rb, line 212 def method_missing(mid, *args) # :nodoc: len = args.length if mname = mid[/.*(?==\z)/] if len != 1 raise ArgumentError, "wrong number of arguments (#{len} for 1)", caller(1) end modifiable?[new_ostruct_member!(mname)] = args[0] elsif len == 0 # and /\A[a-z_]\w*\z/ =~ mid # if @table.key?(mid) new_ostruct_member!(mid) unless frozen? @table[mid] end else begin super rescue NoMethodError => err err.backtrace.shift raise end end end