Sha256: deeef9afbf72d6eef889df4c82e29a5af6c7c8e2f53901377bc254fb44dbd6fa
Contents?: true
Size: 820 Bytes
Versions: 5
Compression:
Stored size: 820 Bytes
Contents
require 'sanford/route' module Sanford class Router attr_reader :routes def initialize(&block) @routes = [] self.instance_eval(&block) if !block.nil? end def service_handler_ns(value = nil) @service_handler_ns = value if !value.nil? @service_handler_ns end def service(name, handler_name) if self.service_handler_ns && !(handler_name =~ /^::/) handler_name = "#{self.service_handler_ns}::#{handler_name}" end @routes.push(Sanford::Route.new(name, handler_name)) end def validate! self.routes.each(&:validate!) true end def inspect reference = '0x0%x' % (self.object_id << 1) "#<#{self.class}:#{reference} " \ "@service_handler_ns=#{self.service_handler_ns.inspect}>" end end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
sanford-0.19.1 | lib/sanford/router.rb |
sanford-0.19.0 | lib/sanford/router.rb |
sanford-0.18.2 | lib/sanford/router.rb |
sanford-0.18.1 | lib/sanford/router.rb |
sanford-0.18.0 | lib/sanford/router.rb |