Sha256: 850a80da7a87c9b27722d18161be1ee54c2c40e3e9cb54a0fdf147477a687058

Contents?: true

Size: 756 Bytes

Versions: 1

Compression:

Stored size: 756 Bytes

Contents

# frozen_string_literal: true

require 'thor'
require 'kovid'

module Kovid
  class CLI < Thor
    desc 'whatis', 'Defines COVID-19'
    def whatis
      Kovid::Nineteen.whatis
    end

    desc 'check', 'Returns data on country'
    method_option :full, aliases: '-f'
    def check(name)
      if options[:full]
        Kovid::Nineteen.country_full(name)
      else
        Kovid::Nineteen.country(name)
      end
    end

    desc 'compare', 'Returns full comparison table for given countries'
    def compare(*name)
      if name[-1] == "-f" || name[-1] == "--full"
        name = name.reverse.drop(1).reverse

        Kovid::Nineteen.country_comparison_full(name)
      else
        Kovid::Nineteen.country_comparison(name)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kovid-0.1.4 lib/kovid/cli.rb