class Manabu::ClassGroup::Enrollment

Public Class Methods

new(client, attributes = {}) click to toggle source
# File lib/manabu/class_group.rb, line 6
def initialize(client, attributes = {})
  @client = client
  @id = attributes.fetch(:id, @id)
  @class_group_id = attributes.fetch(:class_group_id, @class_group_id)
  @student_id = attributes.fetch(:student_id, @student_id)
  @student = nil
end

Public Instance Methods

student() click to toggle source
# File lib/manabu/class_group.rb, line 14
def student
  if @student
    @student
  else
    @student = _fetch_student
  end
end

Private Instance Methods

_fetch_student() click to toggle source
# File lib/manabu/class_group.rb, line 24
def _fetch_student
  response = @client.get("students/#{@student_id}")
  Manabu::Student.new(@client, response)
end