Class: Pleiades::Command::Router
- Inherits:
-
Object
- Object
- Pleiades::Command::Router
- Includes:
- Pleiades::Command::Routing::EventProccessor, Pleiades::Command::Routing::NestBlocks, Pleiades::Command::Routing::PathBuilder, Pleiades::Command::Routing::Reflection, Pleiades::Command::Routing::Validator
- Defined in:
- lib/pleiades/core/command/router.rb
Class Attribute Summary collapse
-
.event ⇒ Object
readonly
Returns the value of attribute event.
- .path_info ⇒ Object
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
- .default_path_info ⇒ Object
- .find_route(event, router_path) ⇒ Object
- .path_found? ⇒ Boolean
- .route(&block) ⇒ Object
Instance Method Summary collapse
-
#initialize(options = nil) ⇒ Router
constructor
A new instance of Router.
Methods included from Pleiades::Command::Routing::EventProccessor
Methods included from Pleiades::Command::Routing::NestBlocks
#_method_, #action, #concern, #method, #nest_blocks, #scope
Methods included from Pleiades::Command::Routing::RouteRefine
Methods included from Pleiades::Command::Routing::PathBuilder
Methods included from Pleiades::Command::Routing::Reflection
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Pleiades::Command::Routing::EventProccessor
Class Attribute Details
.event ⇒ Object (readonly)
Returns the value of attribute event.
20 21 22 |
# File 'lib/pleiades/core/command/router.rb', line 20 def event @event end |
.path_info ⇒ Object
34 35 36 |
# File 'lib/pleiades/core/command/router.rb', line 34 def path_info @path_info || default_path_info end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
47 48 49 |
# File 'lib/pleiades/core/command/router.rb', line 47 def @options end |
Class Method Details
.default_path_info ⇒ Object
38 39 40 |
# File 'lib/pleiades/core/command/router.rb', line 38 def default_path_info new.instance_eval { Pleiades::Command::Routing::Result.create(@options) } end |
.find_route(event, router_path) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/pleiades/core/command/router.rb', line 23 def find_route(event, router_path) @event = event @path_info = nil load router_path end |
.path_found? ⇒ Boolean
42 43 44 |
# File 'lib/pleiades/core/command/router.rb', line 42 def path_found? !!@path_info end |
.route(&block) ⇒ Object
30 31 32 |
# File 'lib/pleiades/core/command/router.rb', line 30 def route(&block) new.instance_eval(&block) if block_given? end |