Class: Evaluator
- Inherits:
-
Object
- Object
- Evaluator
- Defined in:
- lib/evaluator.rb
Instance Method Summary collapse
- #check_gate(user, gate_name) ⇒ Object
- #get_config(user, config_name) ⇒ Object
-
#initialize(store) ⇒ Evaluator
constructor
A new instance of Evaluator.
Constructor Details
#initialize(store) ⇒ Evaluator
Returns a new instance of Evaluator.
14 15 16 17 18 19 |
# File 'lib/evaluator.rb', line 14 def initialize(store) @spec_store = store @initialized = true @ua_parser = UserAgentParser::Parser.new CountryLookup.initialize end |
Instance Method Details
#check_gate(user, gate_name) ⇒ Object
21 22 23 24 |
# File 'lib/evaluator.rb', line 21 def check_gate(user, gate_name) return nil unless @initialized && @spec_store.has_gate?(gate_name) self.eval_spec(user, @spec_store.get_gate(gate_name)) end |
#get_config(user, config_name) ⇒ Object
26 27 28 29 |
# File 'lib/evaluator.rb', line 26 def get_config(user, config_name) return nil unless @initialized && @spec_store.has_config?(config_name) self.eval_spec(user, @spec_store.get_config(config_name)) end |