Class: Wiq::Commands::Registrations

Inherits:
Base
  • Object
show all
Defined in:
lib/wiq/commands/registrations.rb

Instance Method Summary collapse

Methods inherited from Base

exit_on_failure?

Instance Method Details

#answersObject



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/wiq/commands/registrations.rb', line 58

def answers
  params = {
    "profile_id" => options[:profile],
    "profile_type" => options[:profile_type],
    "per_page" => 50
  }
  params["session_id"] = options[:session] if options[:session]
  params["visibility"] = options[:visibility] if options[:visibility]

  records, total = fetch_index("/api/v1/registration_answers", params, key: "registration_answers")
  render_index(
    records, total: total,
    summary: "Listed #{records.size} answers for #{options[:profile_type]} #{options[:profile]}.",
    breadcrumbs: [
      { "cmd" => "wiq registrations questions", "description" => "See the corresponding questions" }
    ]
  )
end

#questionsObject



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/wiq/commands/registrations.rb', line 25

def questions
  records, total = fetch_index("/api/v1/registration_questions", { "per_page" => 100 }, key: "registration_questions")
  render_index(
    records, total: total,
    summary: "Listed #{records.size} registration questions.",
    breadcrumbs: [
      { "cmd" => "wiq reports run RosterReport --append-properties <id1> <id2>",
        "description" => "Surface these as columns on a roster report" }
    ]
  )
end