Sha256: ef52e3c2ca2ba7f3d22ea5f3ba763066939ce8f5bbfc7f131ae34b3b88051028

Contents?: true

Size: 698 Bytes

Versions: 7

Compression:

Stored size: 698 Bytes

Contents

# frozen_string_literal: true

desc "Suggest friends to do activities with"
command :suggest do |suggest|
  suggest.flag [:in],
               arg_name: "LOCATION",
               desc: "Suggest only friends in the given location",
               type: Stripped

  suggest.action do |_, options|
    suggestions = @introvert.suggest(location_name: options[:in])

    puts "Distant friend: "\
      "#{Paint[suggestions[:distant].sample || 'None found', :bold, :magenta]}"
    puts "Moderate friend: "\
      "#{Paint[suggestions[:moderate].sample || 'None found', :bold, :magenta]}"
    puts "Close friend: "\
      "#{Paint[suggestions[:close].sample || 'None found', :bold, :magenta]}"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
friends-0.35 lib/friends/commands/suggest.rb
friends-0.34 lib/friends/commands/suggest.rb
friends-0.33 lib/friends/commands/suggest.rb
friends-0.32 lib/friends/commands/suggest.rb
friends-0.31 lib/friends/commands/suggest.rb
friends-0.30 lib/friends/commands/suggest.rb
friends-0.29 lib/friends/commands/suggest.rb