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



41
42
43
44
45
# File 'lib/w3c_api/commands/ecosystem.rb', line 41

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

#fetchObject



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

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



32
33
34
35
36
# File 'lib/w3c_api/commands/ecosystem.rb', line 32

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

#member_organizationsObject



50
51
52
53
54
# File 'lib/w3c_api/commands/ecosystem.rb', line 50

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