Sha256: 3fee0ea3bfd1b06ef6f003c6131b7df4447b8f84cc8becacb38dcbc38e55952c

Contents?: true

Size: 584 Bytes

Versions: 12

Compression:

Stored size: 584 Bytes

Contents

require 'set'

class Usher
  class Route
    class Path
  
      attr_reader :dynamic_parts, :dynamic_map, :dynamic_indicies, :route, :dynamic_set, :parts
      
      def initialize(route, parts)
        @route = route
        @parts = parts
        @dynamic_indicies = []
        @parts.each_index{|i| @dynamic_indicies << i if @parts[i].is_a?(Variable)}
        @dynamic_parts = @parts.values_at(*@dynamic_indicies)
        @dynamic_map = {}
        @dynamic_parts.each{|p| @dynamic_map[p.name] = p }
        @dynamic_set = Set.new(@dynamic_map.keys)
      end
  
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
joshbuddy-usher-0.2.1 lib/usher/route/path.rb
joshbuddy-usher-0.2.2 lib/usher/route/path.rb
joshbuddy-usher-0.3.0 lib/usher/route/path.rb
joshbuddy-usher-0.3.2 lib/usher/route/path.rb
joshbuddy-usher-0.3.3 lib/usher/route/path.rb
joshbuddy-usher-0.3.4 lib/usher/route/path.rb
joshbuddy-usher-0.3.5 lib/usher/route/path.rb
joshbuddy-usher-0.3.6 lib/usher/route/path.rb
joshbuddy-usher-0.4.0 lib/usher/route/path.rb
joshbuddy-usher-0.4.1 lib/usher/route/path.rb
joshbuddy-usher-0.4.2 lib/usher/route/path.rb
joshbuddy-usher-0.4.3 lib/usher/route/path.rb