Sha256: 034d3d337774ba9f92b41b6d894b1227c5b5fbb66b7fb0b9f6c6dcb29e273893
Contents?: true
Size: 304 Bytes
Versions: 28
Compression:
Stored size: 304 Bytes
Contents
class Module # Default accessors # Provides an accessor with a default class # Usage: # default_attr_reader :a, ["b"] def default_attr_reader(sym, default) define_method :"#{sym}_default" do default end module_eval "def #{sym};@#{sym} ||= #{sym}_default;end" end end
Version data entries
28 entries across 28 versions & 3 rubygems