Class: Lowfidelity::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#buttonObject

Returns the value of attribute button.



3
4
5
# File 'lib/lowfidelity/configuration.rb', line 3

def button
  @button
end

#default_onObject

Returns the value of attribute default_on.



3
4
5
# File 'lib/lowfidelity/configuration.rb', line 3

def default_on
  @default_on
end

#enabledObject

Returns the value of attribute enabled.



3
4
5
# File 'lib/lowfidelity/configuration.rb', line 3

def enabled
  @enabled
end

#fontObject

Returns the value of attribute font.



3
4
5
# File 'lib/lowfidelity/configuration.rb', line 3

def font
  @font
end

#path_filterObject

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

Returns:

  • (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

Returns:

  • (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