class Pleiades::Command::Router

Attributes

event[R]
path_info[W]
options[R]

Public Class Methods

default_path_info() click to toggle source
# 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) click to toggle source
# File lib/pleiades/core/command/router.rb, line 23
def find_route(event, router_path)
  @event = event
  @path_info = nil

  load router_path
end
new(options = nil) click to toggle source
# File lib/pleiades/core/command/router.rb, line 49
def initialize(options = nil)
  @event = Router.event
  @options = options || default_options
end
path_found?() click to toggle source
# File lib/pleiades/core/command/router.rb, line 42
def path_found?
  !!@path_info
end
path_info() click to toggle source
# File lib/pleiades/core/command/router.rb, line 34
def path_info
  @path_info || default_path_info
end
route(&block) click to toggle source
# File lib/pleiades/core/command/router.rb, line 30
def route(&block)
  new.instance_eval(&block) if block_given?
end

Private Instance Methods

nest(new_option, &block) click to toggle source
# File lib/pleiades/core/command/router.rb, line 56
def nest(new_option, &block)
  self.class.new(new_option).instance_eval(&block)
end