class OpenStruct
Public Instance Methods
[](name)
click to toggle source
# File lib/backports/2.0.0/stdlib/ostruct.rb, line 2 def [](name) @table[name.to_sym] end
[]=(name, value)
click to toggle source
# File lib/backports/2.0.0/stdlib/ostruct.rb, line 6 def []=(name, value) modifiable[new_ostruct_member(name)] = value end
each_pair() { |p| ... }
click to toggle source
# File lib/backports/2.0.0/stdlib/ostruct.rb, line 19 def each_pair return to_enum(:each_pair) unless block_given? @table.each_pair{|p| yield p} end
eql?(other)
click to toggle source
# File lib/backports/2.0.0/stdlib/ostruct.rb, line 10 def eql?(other) return false unless other.kind_of?(OpenStruct) @table.eql?(other.table) end
hash()
click to toggle source
# File lib/backports/2.0.0/stdlib/ostruct.rb, line 15 def hash @table.hash end
to_h()
click to toggle source
# File lib/backports/2.0.0/stdlib/ostruct.rb, line 24 def to_h @table.dup end