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

Version Path
auser-poolparty-1.3.0 lib/core/module.rb
auser-poolparty-1.3.1 lib/core/module.rb
auser-poolparty-1.3.10 lib/core/module.rb
auser-poolparty-1.3.11 lib/core/module.rb
auser-poolparty-1.3.12 lib/core/module.rb
auser-poolparty-1.3.13 lib/core/module.rb
auser-poolparty-1.3.14 lib/core/module.rb
auser-poolparty-1.3.15 lib/core/module.rb
auser-poolparty-1.3.16 lib/core/module.rb
auser-poolparty-1.3.17 lib/core/module.rb
auser-poolparty-1.3.2 lib/core/module.rb
auser-poolparty-1.3.3 lib/core/module.rb
auser-poolparty-1.3.4 lib/core/module.rb
auser-poolparty-1.3.5 lib/core/module.rb
auser-poolparty-1.3.6 lib/core/module.rb
auser-poolparty-1.3.7 lib/core/module.rb
auser-poolparty-1.3.8 lib/core/module.rb
fairchild-poolparty-1.3.17 lib/core/module.rb
fairchild-poolparty-1.3.5 lib/core/module.rb
poolparty-1.3.15 lib/core/module.rb