Class: Waylon::Route
- Inherits:
-
Object
- Object
- Waylon::Route
- Extended by:
- Forwardable
- Defined in:
- lib/waylon/route.rb
Overview
A Route is a way of connecting a Sense to the right Skill, allowing for things like permissions, prioritization, and scopes.
Direct Known Subclasses
Waylon::Routes::BlackHole, Waylon::Routes::Default, Waylon::Routes::PermissionDenied
Instance Attribute Summary collapse
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
Instance Method Summary collapse
-
#initialize(name:, destination:, condition:, priority: 10) ⇒ Route
constructor
A new instance of Route.
Constructor Details
#initialize(name:, destination:, condition:, priority: 10) ⇒ Route
Returns a new instance of Route.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/waylon/route.rb', line 15 def initialize(name:, destination:, condition:, priority: 10) validate_name(name) validate_destination(destination) validate_condition(condition) validate_priority(priority) @name = name @destination = destination @condition = condition @priority = priority end |
Instance Attribute Details
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
9 10 11 |
# File 'lib/waylon/route.rb', line 9 def condition @condition end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
9 10 11 |
# File 'lib/waylon/route.rb', line 9 def destination @destination end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/waylon/route.rb', line 9 def name @name end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
9 10 11 |
# File 'lib/waylon/route.rb', line 9 def priority @priority end |