Class: Workarea::Segment::Rules::BrowserInfo
- Inherits:
-
Base
- Object
- Base
- Workarea::Segment::Rules::BrowserInfo
show all
- Defined in:
- app/models/workarea/segment/rules/browser_info.rb
Instance Method Summary
collapse
Methods inherited from Base
slug
#releasable?
add_worker, assert_valid_config!, async, caching_classes?, disable, enable, inline, #run_callbacks, workers, workers_list
#embedded_children
Instance Method Details
#device_match?(browser) ⇒ Boolean
19
20
21
|
# File 'app/models/workarea/segment/rules/browser_info.rb', line 19
def device_match?(browser)
device.any? { |d| browser.device.try("#{d}?") }
end
|
#general_match?(browser) ⇒ Boolean
15
16
17
|
# File 'app/models/workarea/segment/rules/browser_info.rb', line 15
def general_match?(browser)
general.any? { |g| browser.try("#{g}?") }
end
|
23
24
25
|
# File 'app/models/workarea/segment/rules/browser_info.rb', line 23
def platform_match?(browser)
platform.any? { |p| browser.platform.try("#{p}?") }
end
|
#qualifies?(visit) ⇒ Boolean
9
10
11
12
13
|
# File 'app/models/workarea/segment/rules/browser_info.rb', line 9
def qualifies?(visit)
general_match?(visit.browser) ||
device_match?(visit.browser) ||
platform_match?(visit.browser)
end
|