Sha256: d5b48cf1bc29308bb567d033e3db9eba41083d073197a1e751ff8f98197ddc88
Contents?: true
Size: 504 Bytes
Versions: 6
Compression:
Stored size: 504 Bytes
Contents
require 'ostruct' # Code shamelessly stolen from http://errtheblog.com/post/30 class SuperStruct < OpenStruct include Enumerable def members methods(false).grep(/=/).map { |m| m[0...-1] } end def each members.each do |method| yield send(method) end self end def each_pair members.each do |method| yield method, send(method) end self end def [](member) send(member) end def []=(member, value) send("#{member}=", value) end end
Version data entries
6 entries across 6 versions & 1 rubygems