Class: W3cApi::Commands::Group

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

Overview

Thor CLI command for group operations

Instance Method Summary collapse

Methods included from UserAgentOption

included, #initialize

Methods included from OutputFormatter

#output_results

Instance Method Details

#chairsObject



69
70
71
72
73
# File 'lib/w3c_api/commands/group.rb', line 69

def chairs
  client = W3cApi::Client.new
  chairs = client.group_chairs(options[:id])
  output_results(chairs, options[:format])
end

#chartersObject



59
60
61
62
63
# File 'lib/w3c_api/commands/group.rb', line 59

def charters
  client = W3cApi::Client.new
  charters = client.group_charters(options[:id])
  output_results(charters, options[:format])
end

#fetchObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/w3c_api/commands/group.rb', line 20

def fetch
  client = W3cApi::Client.new

  groups = if options[:id]
             # Single group
             client.group(options[:id])
           elsif options[:type]
             client.groups(type: options[:type])
           else
             client.groups
           end

  output_results(groups, options[:format])
end

#participationsObject



89
90
91
92
93
# File 'lib/w3c_api/commands/group.rb', line 89

def participations
  client = W3cApi::Client.new
  participations = client.group_participations(options[:id])
  output_results(participations, options[:format])
end

#specificationsObject



49
50
51
52
53
# File 'lib/w3c_api/commands/group.rb', line 49

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

#team_contactsObject



79
80
81
82
83
# File 'lib/w3c_api/commands/group.rb', line 79

def team_contacts
  client = W3cApi::Client.new
  team_contacts = client.group_team_contacts(options[:id])
  output_results(team_contacts, options[:format])
end

#usersObject



39
40
41
42
43
# File 'lib/w3c_api/commands/group.rb', line 39

def users
  client = W3cApi::Client.new
  users = client.group_users(options[:id])
  output_results(users, options[:format])
end