Class: Lowfidelity::Configuration
- Inherits:
-
Object
- Object
- Lowfidelity::Configuration
- Defined in:
- lib/lowfidelity/configuration.rb
Instance Attribute Summary collapse
-
#button ⇒ Object
Returns the value of attribute button.
-
#default_on ⇒ Object
Returns the value of attribute default_on.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#font ⇒ Object
Returns the value of attribute font.
-
#path_filter ⇒ Object
Returns the value of attribute path_filter.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #path_allowed?(path) ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 |
# File 'lib/lowfidelity/configuration.rb', line 5 def initialize @enabled = nil @path_filter = nil @font = "Caveat" @default_on = false @button = true end |
Instance Attribute Details
#button ⇒ Object
Returns the value of attribute button.
3 4 5 |
# File 'lib/lowfidelity/configuration.rb', line 3 def @button end |
#default_on ⇒ Object
Returns the value of attribute default_on.
3 4 5 |
# File 'lib/lowfidelity/configuration.rb', line 3 def default_on @default_on end |
#enabled ⇒ Object
Returns the value of attribute enabled.
3 4 5 |
# File 'lib/lowfidelity/configuration.rb', line 3 def enabled @enabled end |
#font ⇒ Object
Returns the value of attribute font.
3 4 5 |
# File 'lib/lowfidelity/configuration.rb', line 3 def font @font end |
#path_filter ⇒ Object
Returns the value of attribute path_filter.
3 4 5 |
# File 'lib/lowfidelity/configuration.rb', line 3 def path_filter @path_filter end |
Instance Method Details
#enabled? ⇒ Boolean
13 14 15 16 |
# File 'lib/lowfidelity/configuration.rb', line 13 def enabled? return @enabled unless @enabled.nil? defined?(Rails) && Rails.env.development? end |
#path_allowed?(path) ⇒ Boolean
18 19 20 21 |
# File 'lib/lowfidelity/configuration.rb', line 18 def path_allowed?(path) return true if @path_filter.nil? @path_filter.call(path) end |