Class: Stellar::Members
- Inherits:
-
Object
- Object
- Stellar::Members
- Defined in:
- lib/stellar/members.rb
Overview
Stellar client scoped to a course’s Members module.
Defined Under Namespace
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Generic Stellar client used to make requests.
-
#course ⇒ Object
readonly
The course whose membership is exposed by this client.
-
#navigation ⇒ Object
readonly
Maps the text in navigation links to URI objects.
Instance Method Summary collapse
-
#initialize(course) ⇒ Members
constructor
Creates a Stellar client scoped to a course’s Membership module.
-
#photos ⇒ Stellar::Gradebook::PhotoList
All member photos in this course’s Membership module.
Constructor Details
#initialize(course) ⇒ Members
Creates a Stellar client scoped to a course’s Membership module.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/stellar/members.rb', line 20 def initialize(course) @course = course @client = course.client @url = course.['Membership'] page = @client.get_nokogiri @url @navigation = Hash[page.css('#toolBox dd a').map { |link| [link.inner_text.strip, URI.join(page.url, link['href'])] }] end |
Instance Attribute Details
#client ⇒ Object (readonly)
Generic Stellar client used to make requests.
15 16 17 |
# File 'lib/stellar/members.rb', line 15 def client @client end |
#course ⇒ Object (readonly)
The course whose membership is exposed by this client.
12 13 14 |
# File 'lib/stellar/members.rb', line 12 def course @course end |
#navigation ⇒ Object (readonly)
Maps the text in navigation links to URI objects.
Example: navigation => <# URI: …/ >
9 10 11 |
# File 'lib/stellar/members.rb', line 9 def @navigation end |