Class: Adapt::RoutingBuilder::Intent
- Inherits:
-
Object
- Object
- Adapt::RoutingBuilder::Intent
- Defined in:
- lib/adapt/routing_builder.rb
Instance Attribute Summary collapse
-
#entities ⇒ Object
readonly
Returns the value of attribute entities.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Intent
constructor
A new instance of Intent.
- #optional(entity) ⇒ Object
- #required(entity) ⇒ Object
Constructor Details
#initialize(name) ⇒ Intent
Returns a new instance of Intent.
9 10 11 12 13 |
# File 'lib/adapt/routing_builder.rb', line 9 def initialize(name) @name = name @entities = [] end |
Instance Attribute Details
#entities ⇒ Object (readonly)
Returns the value of attribute entities.
7 8 9 |
# File 'lib/adapt/routing_builder.rb', line 7 def entities @entities end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/adapt/routing_builder.rb', line 7 def name @name end |
Instance Method Details
#optional(entity) ⇒ Object
21 22 23 24 25 |
# File 'lib/adapt/routing_builder.rb', line 21 def optional(entity) @entities << {entity => :optional} return self end |
#required(entity) ⇒ Object
15 16 17 18 19 |
# File 'lib/adapt/routing_builder.rb', line 15 def required(entity) @entities << {entity => :required} return self end |