Class: PodIdent::DetectionResult
- Inherits:
-
Object
- Object
- PodIdent::DetectionResult
- Defined in:
- lib/pod_ident/detection_result.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#platform ⇒ Object
Returns the value of attribute platform.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
-
#user_agent ⇒ Object
readonly
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#initialize(rule, user_agent) ⇒ DetectionResult
constructor
A new instance of DetectionResult.
- #platform_rule ⇒ Object
- #positive? ⇒ Boolean
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
#app ⇒ Object (readonly)
Returns the value of attribute app.
5 6 7 |
# File 'lib/pod_ident/detection_result.rb', line 5 def app @app end |
#platform ⇒ Object
Returns the value of attribute platform.
6 7 8 |
# File 'lib/pod_ident/detection_result.rb', line 6 def platform @platform end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
5 6 7 |
# File 'lib/pod_ident/detection_result.rb', line 5 def rule @rule end |
#user_agent ⇒ Object (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_rule ⇒ Object
20 21 22 |
# File 'lib/pod_ident/detection_result.rb', line 20 def platform_rule @rule[:platform] end |
#positive? ⇒ Boolean
16 17 18 |
# File 'lib/pod_ident/detection_result.rb', line 16 def positive? !@app.nil? end |