Class: Himari::RuleProcessor::Result
- Inherits:
-
Struct
- Object
- Struct
- Himari::RuleProcessor::Result
- Defined in:
- lib/himari/rule_processor.rb
Instance Attribute Summary collapse
-
#allowed ⇒ Object
Returns the value of attribute allowed.
-
#decision ⇒ Object
Returns the value of attribute decision.
-
#decision_log ⇒ Object
Returns the value of attribute decision_log.
-
#explicit_deny ⇒ Object
Returns the value of attribute explicit_deny.
-
#rule_name ⇒ Object
Returns the value of attribute rule_name.
-
#suggestion ⇒ Object
Returns the value of attribute suggestion.
-
#user_facing_message ⇒ Object
Returns the value of attribute user_facing_message.
Instance Method Summary collapse
Instance Attribute Details
#allowed ⇒ Object
Returns the value of attribute allowed
5 6 7 |
# File 'lib/himari/rule_processor.rb', line 5 def allowed @allowed end |
#decision ⇒ Object
Returns the value of attribute decision
5 6 7 |
# File 'lib/himari/rule_processor.rb', line 5 def decision @decision end |
#decision_log ⇒ Object
Returns the value of attribute decision_log
5 6 7 |
# File 'lib/himari/rule_processor.rb', line 5 def decision_log @decision_log end |
#explicit_deny ⇒ Object
Returns the value of attribute explicit_deny
5 6 7 |
# File 'lib/himari/rule_processor.rb', line 5 def explicit_deny @explicit_deny end |
#rule_name ⇒ Object
Returns the value of attribute rule_name
5 6 7 |
# File 'lib/himari/rule_processor.rb', line 5 def rule_name @rule_name end |
#suggestion ⇒ Object
Returns the value of attribute suggestion
5 6 7 |
# File 'lib/himari/rule_processor.rb', line 5 def suggestion @suggestion end |
#user_facing_message ⇒ Object
Returns the value of attribute user_facing_message
5 6 7 |
# File 'lib/himari/rule_processor.rb', line 5 def @user_facing_message end |
Instance Method Details
#as_log ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/himari/rule_processor.rb', line 6 def as_log { rule_name: rule_name, allowed: allowed, explicit_deny: explicit_deny, decision: decision&.as_log, decision_log: decision_log.map(&:to_h), }.tap do |x| x[:suggestion] = suggestion if suggestion end end |