Class: PodIdent::DetectionResult

Inherits:
Object
  • Object
show all
Defined in:
lib/pod_ident/detection_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule, user_agent) ⇒ DetectionResult

Returns a new instance of DetectionResult.



8
9
10
11
12
13
14
# File 'lib/pod_ident/detection_result.rb', line 8

def initialize(rule, user_agent)
  @user_agent = user_agent
  return unless rule

  @rule = rule
  @app = rule[:app]
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



5
6
7
# File 'lib/pod_ident/detection_result.rb', line 5

def app
  @app
end

#platformObject

Returns the value of attribute platform.



6
7
8
# File 'lib/pod_ident/detection_result.rb', line 6

def platform
  @platform
end

#ruleObject (readonly)

Returns the value of attribute rule.



5
6
7
# File 'lib/pod_ident/detection_result.rb', line 5

def rule
  @rule
end

#user_agentObject (readonly)

Returns the value of attribute user_agent.



5
6
7
# File 'lib/pod_ident/detection_result.rb', line 5

def user_agent
  @user_agent
end

Instance Method Details

#platform_ruleObject



20
21
22
# File 'lib/pod_ident/detection_result.rb', line 20

def platform_rule
  @rule[:platform]
end

#positive?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/pod_ident/detection_result.rb', line 16

def positive?
  !@app.nil?
end