lib/taketo/destination_matcher.rb in taketo-0.1.3 vs lib/taketo/destination_matcher.rb in taketo-0.2.0.alpha
- old
+ new
@@ -1,22 +1,22 @@
module Taketo
class DestinationMatcher
- def initialize(servers)
- @servers = servers
+ def initialize(nodes)
+ @nodes = nodes
end
def matches
(path_matches + global_alias_matches).uniq
end
private
def path_matches
- @servers.map(&:path)
+ @nodes.map(&:path)
end
def global_alias_matches
- @servers.map(&:global_alias).map(&:to_s).reject(&:empty?)
+ @nodes.select { |n| n.respond_to?(:global_alias) }.map(&:global_alias).map(&:to_s).reject(&:empty?)
end
end
end