Sha256: 6fe95d42212c3ec7f6ad6d6495bca72eb57e58671fe07818b5601e0dd5ebae55

Contents?: true

Size: 359 Bytes

Versions: 3

Compression:

Stored size: 359 Bytes

Contents

module Taketo
  class DestinationMatcher
    def initialize(servers)
      @servers = servers
    end

    def matches
      (path_matches + global_alias_matches).uniq
    end

    private

    def path_matches
      @servers.map(&:path)
    end

    def global_alias_matches
      @servers.map(&:global_alias).map(&:to_s).reject(&:empty?)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
taketo-0.1.3 lib/taketo/destination_matcher.rb
taketo-0.1.2 lib/taketo/destination_matcher.rb
taketo-0.1.1 lib/taketo/destination_matcher.rb