Sha256: db99339cb8899873b06d40155ad85e4d4577b2f307c6d26853629b3b13ec817b

Contents?: true

Size: 319 Bytes

Versions: 4

Compression:

Stored size: 319 Bytes

Contents

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

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

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

    port 80
  }

  p conf

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fattr-1.1.0 samples/e.rb
fattr-1.0.1 samples/e.rb
fattr-1.0.2 samples/e.rb
fattr-1.0.3 samples/e.rb