Module: WSOC::Helpers::Course
- Defined in:
- lib/wsoc/helpers/course.rb
Instance Method Summary collapse
-
#course_dir ⇒ String
The course directory.
-
#course_fail ⇒ String
The full course failure URL.
-
#course_page(name) ⇒ String
Renders a course page.
-
#course_start ⇒ String
The full course starting URL.
-
#remote_url(path) ⇒ String
Generates a remote URL containing a given path.
-
#specs ⇒ Array<Hash>
The specs for the course.
-
#title_for(*names) ⇒ String
Renders a title string.
Instance Method Details
#course_dir ⇒ String
The course directory.
99 100 101 |
# File 'lib/wsoc/helpers/course.rb', line 99 def course_dir "#{Config::COURSE_DIR}/" end |
#course_fail ⇒ String
The full course failure URL.
131 132 133 |
# File 'lib/wsoc/helpers/course.rb', line 131 def course_fail remote_url Config::COURSE_FAIL_PATH end |
#course_page(name) ⇒ String
Renders a course page.
41 42 43 |
# File 'lib/wsoc/helpers/course.rb', line 41 def course_page(name) erb name, :layout => false end |
#course_start ⇒ String
The full course starting URL.
115 116 117 |
# File 'lib/wsoc/helpers/course.rb', line 115 def course_start remote_url Config::COURSE_START_PATH end |
#remote_url(path) ⇒ String
Generates a remote URL containing a given path.
79 80 81 82 83 84 85 |
# File 'lib/wsoc/helpers/course.rb', line 79 def remote_url(path) s = "#{request.scheme}://#{request.host}" s << ":#{request.port}" if request.port != 80 s << path return s end |
#specs ⇒ Array<Hash>
The specs for the course.
143 144 145 |
# File 'lib/wsoc/helpers/course.rb', line 143 def specs CourseSpecs.map(request.host,request.port) end |
#title_for(*names) ⇒ String
Renders a title string.
60 61 62 |
# File 'lib/wsoc/helpers/course.rb', line 60 def title_for(*names) (['Web Spider Obstacle Course'] + names).join(' :: ') end |