Class: W3cApi::Commands::Translation

Inherits:
Thor
  • Object
show all
Includes:
OutputFormatter
Defined in:
lib/w3c_api/commands/translation.rb

Overview

Thor CLI command for translation operations

Instance Method Summary collapse

Methods included from OutputFormatter

#output_results

Instance Method Details

#fetchObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/w3c_api/commands/translation.rb', line 17

def fetch
  client = W3cApi::Client.new

  translations = if options[:id]
                   # Single specification version
                   client.translation(options[:id])
                 else
                   # All translations
                   client.translations
                 end

  output_results(translations, options[:format])
end