Class: Entraceable::Preference

Inherits:
Object
  • Object
show all
Defined in:
lib/entraceable_preference.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePreference

Returns a new instance of Preference.



7
8
9
10
# File 'lib/entraceable_preference.rb', line 7

def initialize
  @default_level = :debug
  @enabled = Rails.env.development?
end

Instance Attribute Details

#default_levelObject

Returns the value of attribute default_level.



5
6
7
# File 'lib/entraceable_preference.rb', line 5

def default_level
  @default_level
end

Instance Method Details

#disableObject



12
13
14
# File 'lib/entraceable_preference.rb', line 12

def disable
  @enabled = false
end

#enableObject



16
17
18
# File 'lib/entraceable_preference.rb', line 16

def enable
  @enabled = true
end

#enabled?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/entraceable_preference.rb', line 20

def enabled?
  @enabled
end