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-3.19.6 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.19.5 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.19.4 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.19.3 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.19.2 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.19.1 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.19.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.18.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.17.2 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.17.1 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.17.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.16.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.15.3 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.15.2 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.15.1 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.15.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.14.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.13.1 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.13.0 ./lib/rubypitaya/core/routes_base.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rubypitaya-3.12.1/lib/rubypitaya/core/routes_base.rb