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
abiquo-etk-0.4.23 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.22 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.20 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.19 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.18 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.17 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.16 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.15 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.14 vendor/fattr-2.1.0/samples/f.rb
abiquo-etk-0.4.13 vendor/fattr-2.1.0/samples/f.rb
fattr-2.1.0 samples/f.rb
fattr-2.0.0 samples/f.rb