Class: W3cApi::Commands::User

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

Overview

Thor CLI command for user operations

Instance Method Summary collapse

Methods included from OutputFormatter

#output_results

Instance Method Details

#affiliationsObject



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

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

#chair_of_groupsObject



71
72
73
74
75
# File 'lib/w3c_api/commands/user.rb', line 71

def chair_of_groups
  client = W3cApi::Client.new
  groups = client.user_chair_of_groups(options[:id])
  output_results(groups, options[:format])
end

#fetchObject



17
18
19
20
21
# File 'lib/w3c_api/commands/user.rb', line 17

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

#groupsObject



27
28
29
30
31
# File 'lib/w3c_api/commands/user.rb', line 27

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

#participationsObject



60
61
62
63
64
# File 'lib/w3c_api/commands/user.rb', line 60

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

#specificationsObject



38
39
40
41
42
# File 'lib/w3c_api/commands/user.rb', line 38

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

#team_contact_of_groupsObject



82
83
84
85
86
# File 'lib/w3c_api/commands/user.rb', line 82

def team_contact_of_groups
  client = W3cApi::Client.new
  groups = client.user_team_contact_of_groups(options[:id])
  output_results(groups, options[:format])
end