def instances
      @instances ||= begin
        if $DEBUG
          puts 'Entering instance_ids'
          puts "Search Term: #{search_terms.inspect}"
        end

        instance_ids = search_terms.each_with_object([]) do |search_term, m|
          if (/^i-/ =~ search_term) && !(/\./ =~ search_term)
            m << search_term
          else
            ec2.servers.each do |server|
              next unless server.tags.key?('Name') \
                && (server.tags['Name'] != '') \
                && (/#{search_term}/i =~ server.tags['Name'])

              m << server.id
            end
          end
        end

        if instance_ids.empty?
          puts 'No instances by that Name/ID in this account'
          exit 1
        end

        puts "Found instances: #{instance_ids.inspect}" if $DEBUG

        ec2.servers.all 'instance-id' => instance_ids
      end
    end
def instances
      @instances ||= begin
        if $DEBUG
          puts 'Entering instance_ids'
          puts "Search Term: #{search_terms.inspect}"
        end

        instance_ids = search_terms.each_with_object([]) do |search_term, m|
          if (/^i-/ =~ search_term) && !(/\./ =~ search_term)
            m << search_term
          else
            ec2.servers.each do |server|
              next unless server.tags.key?('Name') \
                && (server.tags['Name'] != '') \
                && (/#{search_term}/i =~ server.tags['Name'])

              m << server.id
            end
          end
        end

        if instance_ids.empty?
          puts 'No instances by that Name/ID in this account'
          exit 1
        end

        puts "Found instances: #{instance_ids.inspect}" if $DEBUG

        ec2.servers.all 'instance-id' => instance_ids
      end
    end
TODO: Naming/MemoizedInstanceVariableName: Memoized variable @instance_ids does
 not match method name instances.