Sha256: e9507c535ecff0086b3c8944b59a4cbd9358ef3f05dd44e22d56075a7d5b499d

Contents?: true

Size: 332 Bytes

Versions: 11

Compression:

Stored size: 332 Bytes

Contents

#
# my favourite element of attributes is that getters can also be setters.
# this allows incredibly clean looking code like
#
  require 'attributes'

  class Config
    attributes %w( host port)
    def initialize(&block) instance_eval &block end
  end

  conf = Config.new{
    host 'codeforpeople.org'

    port 80
  }

  p conf

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
attributes1-5.0.3 samples/e.rb
attributes1-5.0.2 samples/e.rb
attributes-5.0.1 samples/e.rb
attributes-3.7.0 samples/e.rb
attributes-4.0.0 samples/e.rb
attributes-4.1.0 samples/e.rb
attributes-3.3.0 samples/e.rb
attributes-3.5.0 samples/e.rb
attributes-3.6.0 samples/e.rb
attributes-5.0.0 samples/e.rb
attributes-3.2.0 samples/e.rb