Sha256: 43361709a608528e3981cd3cf6f457010b0016e4671e9436de388f79b82adf4a

Contents?: true

Size: 967 Bytes

Versions: 4

Compression:

Stored size: 967 Bytes

Contents

require "thor"
require_relative "./data"
require_relative "./consts"
require "json"

module ValorantDailyStore
  class CLI < Thor
    def self.exit_on_failure?
      true
    end

    desc "get", "Get your daily Valorant shop"
    option :username, type: :string, required: true, banner: "Riot username", aliases: ["-u"]
    option :password, type: :string, required: true, banner: "Riot password", aliases: ["-p"]
    option :region, type: :string, required: true, banner: "Account's region", aliases: ["-r"]
    option :language, type: :string, required: false, banner: "Language used to translate weapons name", default: "en-US", aliases: ["-l"], enum: ValorantDailyStore::VALORANT_API_LANGUAGES

    def get
      response = Data.new(username: options[:username], password: options[:password], region: options[:region], language: options[:language]).get
      puts JSON.pretty_generate(response)
    rescue => e
      puts "ERROR: #{e.message}"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
valorant_daily_store-1.0.6 lib/valorant_daily_store/cli.rb
valorant_daily_store-1.0.5 lib/valorant_daily_store/cli.rb
valorant_daily_store-1.0.4 lib/valorant_daily_store/cli.rb
valorant_daily_store-1.0.3 lib/valorant_daily_store/cli.rb