Class: Taketo::Actions::Matches

Inherits:
BaseAction show all
Defined in:
lib/taketo/actions/matches.rb

Instance Attribute Summary

Attributes inherited from BaseAction

#destination_path, #options

Instance Method Summary collapse

Methods inherited from BaseAction

#config

Constructor Details

#initialize(options) ⇒ Matches

Returns a new instance of Matches.



11
12
13
14
15
16
17
18
19
20
# File 'lib/taketo/actions/matches.rb', line 11

def initialize(options)
  super
  @resolver = if options[:list]
    GroupResolver
  elsif options[:view]
    NodeResolver
  else
    ServerResolver
  end.new(config, destination_path)
end

Instance Method Details

#runObject



22
23
24
# File 'lib/taketo/actions/matches.rb', line 22

def run
  puts DestinationMatcher.new(@resolver.nodes).matches.join(" ")
end