Class: W3cApi::Commands::Ecosystem

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

Overview

Thor CLI command for ecosystem operations

Instance Method Summary collapse

Methods included from OutputFormatter

#output_results

Instance Method Details

#evangelistsObject



46
47
48
49
50
# File 'lib/w3c_api/commands/ecosystem.rb', line 46

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

#fetchObject



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

def fetch
  client = W3cApi::Client.new

  ecosystems = if options[:shortname]
                 # Single ecosystem
                 client.ecosystem(options[:shortname])
               else
                 client.ecosystems
               end

  output_results(ecosystems, options[:format])
end

#groupsObject



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

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

#member_organizationsObject



57
58
59
60
61
# File 'lib/w3c_api/commands/ecosystem.rb', line 57

def member_organizations
  client = W3cApi::Client.new
  organizations = client.ecosystem_member_organizations(options[:shortname])
  output_results(organizations, options[:format])
end