Class: Yacs::Cli::Command
- Inherits:
-
Thor
- Object
- Thor
- Yacs::Cli::Command
- Defined in:
- lib/yacs/cli.rb
Constant Summary collapse
- COURSE_API_OPTIONS =
%w(id name number department_code department_id search)- SECTION_API_OPTIONS =
%w(id name crn instructors course_id)- SYSTEM_OPTIONS =
%w(v q)
Instance Method Summary collapse
Instance Method Details
#course ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/yacs/cli.rb', line 16 def course courses = Yacs::Client.new.courses() fields = %w(id) unless ['q'] fields << 'name' fields << 'description' if ['v'] end Printer.print courses, fields end |
#section ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/yacs/cli.rb', line 29 def section sections = Yacs::Client.new.sections() fields = %w(id) unless ['q'] fields.concat %w(name crn instructors seats_taken seats) end Printer.print sections, fields end |