Class: W3cApi::Commands::Series

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

Overview

Thor CLI command for series 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/series.rb', line 17

def fetch
  client = W3cApi::Client.new

  series = if options[:shortname]
             # Single series
             client.series_by_shortname(options[:shortname])
           else
             # All series
             client.series
           end

  output_results(series, options[:format])
end

#specificationsObject



35
36
37
38
39
# File 'lib/w3c_api/commands/series.rb', line 35

def specifications
  client = W3cApi::Client.new
  specifications = client.series_specifications(options[:shortname])
  output_results(specifications, options[:format])
end