Sha256: b8b4ab27e3be1daf853ff0e84573dd514a5d5d247d029807d663ea8eaa8821e2

Contents?: true

Size: 692 Bytes

Versions: 123

Compression:

Stored size: 692 Bytes

Contents

module RubyPitaya

  class RoutesBase

    def initialize
      @handler_name_map = {}

      setup
    end

    def setup
    end

    def match(route_name, to:)
      handler_name, action_name = to.split('#')
      new_handler_name, new_action_name = route_name.split('.')

      if new_action_name.nil?
        set_handler_name(handler_name, new_handler_name)
      end
    end

    def get_new_handler_name(handler_name)
      return handler_name unless @handler_name_map.include?(handler_name)

      @handler_name_map[handler_name]
    end

    private

    def set_handler_name(handler_name, new_handler_name)
      @handler_name_map[handler_name] = new_handler_name
    end
  end
end

Version data entries

123 entries across 119 versions & 1 rubygems

Version Path
rubypitaya-2.11.1 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.11.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.10.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.9.3 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.9.2 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.9.1 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.9.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.8.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.7.5 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.7.4 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.7.3 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.7.1 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.7.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.6.4 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.6.3 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.6.2 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.6.1 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.6.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.5.1 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-2.5.0 ./lib/rubypitaya/core/routes_base.rb