Class: Analytic::Config
- Inherits:
-
Object
- Object
- Analytic::Config
- Defined in:
- lib/analytic/config.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #ip_v4_mask? ⇒ Boolean
- #ip_v6_mask? ⇒ Boolean
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
14 15 16 17 18 |
# File 'lib/analytic/config.rb', line 14 def initialize @timezone = Time.zone @ip_v4_mask = 24 # e.g. 255.255.255.255 => '255.255.255.0/255.255.255.0' @ip_v6_mask = 48 # e.g. 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' => 'ffff:ffff:ffff:0000:0000:0000:0000:0000' end |
Instance Attribute Details
#ip_v4_mask ⇒ Integer
9 10 11 |
# File 'lib/analytic/config.rb', line 9 def ip_v4_mask @ip_v4_mask end |
#ip_v6_mask ⇒ Integer
12 13 14 |
# File 'lib/analytic/config.rb', line 12 def ip_v6_mask @ip_v6_mask end |
#timezone ⇒ String
6 7 8 |
# File 'lib/analytic/config.rb', line 6 def timezone @timezone end |
Instance Method Details
#ip_v4_mask? ⇒ Boolean
21 22 23 |
# File 'lib/analytic/config.rb', line 21 def ip_v4_mask? @ip_v4_mask.present? end |
#ip_v6_mask? ⇒ Boolean
26 27 28 |
# File 'lib/analytic/config.rb', line 26 def ip_v6_mask? @ip_v6_mask.present? end |