Class: Kameleoon::Targeting::GeolocationCondition Private
- Defined in:
- lib/kameleoon/targeting/conditions/geolocation_condition.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary
Attributes inherited from Condition
Instance Method Summary collapse
- #check(geolocation) ⇒ Object private
-
#initialize(json_condition) ⇒ GeolocationCondition
constructor
private
A new instance of GeolocationCondition.
Constructor Details
#initialize(json_condition) ⇒ GeolocationCondition
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of GeolocationCondition.
10 11 12 13 14 15 |
# File 'lib/kameleoon/targeting/conditions/geolocation_condition.rb', line 10 def initialize(json_condition) super(json_condition) @country = json_condition['country'] @region = json_condition['region'] @city = json_condition['city'] end |
Instance Method Details
#check(geolocation) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/kameleoon/targeting/conditions/geolocation_condition.rb', line 17 def check(geolocation) geolocation.is_a?(Kameleoon::Geolocation) && check_targeting(geolocation) end |