Class: Land::Config
- Inherits:
-
HashWithIndifferentAccess
- Object
- HashWithIndifferentAccess
- Land::Config
- Defined in:
- lib/land/config.rb
Instance Attribute Summary collapse
- #blank_user_agent_string ⇒ Object
-
#enabled ⇒ Object
Returns the value of attribute enabled.
- #schema ⇒ Object
-
#secure_cookie ⇒ Object
Returns the value of attribute secure_cookie.
- #untracked_ips ⇒ Object
- #untracked_paths ⇒ Object
Instance Method Summary collapse
- #add_untracked_ip(ip) ⇒ Object
- #add_untracked_path(path) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #visit_timeout ⇒ Object
- #visit_timeout=(value) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
10 11 12 13 |
# File 'lib/land/config.rb', line 10 def initialize @enabled = false @secure_cookie = false end |
Instance Attribute Details
#blank_user_agent_string ⇒ Object
15 16 17 |
# File 'lib/land/config.rb', line 15 def blank_user_agent_string @blank_user_agent_string ||= 'user agent missing' end |
#enabled ⇒ Object
Returns the value of attribute enabled.
5 6 7 |
# File 'lib/land/config.rb', line 5 def enabled @enabled end |
#schema ⇒ Object
31 32 33 |
# File 'lib/land/config.rb', line 31 def schema @schema ||= 'land' end |
#secure_cookie ⇒ Object
Returns the value of attribute secure_cookie.
5 6 7 |
# File 'lib/land/config.rb', line 5 def @secure_cookie end |
#untracked_ips ⇒ Object
35 36 37 |
# File 'lib/land/config.rb', line 35 def untracked_ips @untracked_ips ||= [] end |
#untracked_paths ⇒ Object
43 44 45 |
# File 'lib/land/config.rb', line 43 def untracked_paths @untracked_paths ||= [] end |
Instance Method Details
#add_untracked_ip(ip) ⇒ Object
39 40 41 |
# File 'lib/land/config.rb', line 39 def add_untracked_ip(ip) @untracked_ips << ip end |
#add_untracked_path(path) ⇒ Object
47 48 49 |
# File 'lib/land/config.rb', line 47 def add_untracked_path(path) @untracked_paths << path end |
#visit_timeout ⇒ Object
51 52 53 |
# File 'lib/land/config.rb', line 51 def visit_timeout @visit_timeout ||= 30.minutes end |
#visit_timeout=(value) ⇒ Object
55 56 57 58 59 60 |
# File 'lib/land/config.rb', line 55 def visit_timeout=(value) raise ArgumentError unless [Integer, ActiveSupport::Duration].include?(value.class) raise ArgumentError, "must be positive" unless value.positive? @visit_timeout = value end |