Sha256: ef2fa5f111fc140497164ce30217e2a7d999cfa62038444a5f8f6a20201e03b6

Contents?: true

Size: 345 Bytes

Versions: 32

Compression:

Stored size: 345 Bytes

Contents

#
# of course fattrs works as well at class/module level as at instance
# level
#
  require 'fattr'

  module Logging 
    Level_names = {
      0 => 'INFO',
      # ...
      42 => 'DEBUG',
    }

    class << Logging
      fattr 'level' => 42
      fattr('level_name'){ Level_names[level] }
    end
  end

p Logging.level
p Logging.level_name

Version data entries

32 entries across 32 versions & 3 rubygems

Version Path
fattr-2.4.0 samples/f.rb
fattr-2.3.0 samples/f.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/fattr-2.2.2/samples/f.rb
fattr-2.2.2 samples/f.rb
abiquo-etk-0.6.4 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.6.3 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.6.2 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.6.1 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.6.0 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.5.9 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.5.8 vendor/fattr-2.1.0/samples/f.rb
fattr-2.2.1 samples/f.rb
abiquo-etk-0.5.3 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.42 vendor/fattr-2.1.0/samples/f.rb
fattr-2.2.0 samples/f.rb
abiquo-etk-0.4.33 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.32 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.29 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.25 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.24 vendor/fattr-2.1.0/samples/f.rb