Class: Blackbaud::BlackbaudClass

Inherits:
BlackbaudObject show all
Defined in:
lib/blackbaud-client/api/blackbaud_class.rb

Instance Attribute Summary collapse

Attributes inherited from BlackbaudObject

#client

Instance Method Summary collapse

Methods inherited from BlackbaudObject

#format_date, #to_hash, #to_json

Constructor Details

#initialize(options) ⇒ BlackbaudClass

Returns a new instance of BlackbaudClass.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/blackbaud-client/api/blackbaud_class.rb', line 5

def initialize(options)
  {
    'faculty'   => Blackbaud::Person::USER_TYPE[:faculty],
    'students'  => Blackbaud::Person::USER_TYPE[:student],
  }.each do |response_key, type_id|
    if options.fetch(:values)[response_key].is_a?(Enumerable)
      options.fetch(:values)[response_key].map! do |person|
        person['type'] = type_id
        Blackbaud::Person.new({values: person})
      end
    end
  end

  super
end

Instance Attribute Details

#course_idObject

Returns the value of attribute course_id.



3
4
5
# File 'lib/blackbaud-client/api/blackbaud_class.rb', line 3

def course_id
  @course_id
end

#course_nameObject

Returns the value of attribute course_name.



3
4
5
# File 'lib/blackbaud-client/api/blackbaud_class.rb', line 3

def course_name
  @course_name
end

#ea7_class_idObject

Returns the value of attribute ea7_class_id.



3
4
5
# File 'lib/blackbaud-client/api/blackbaud_class.rb', line 3

def ea7_class_id
  @ea7_class_id
end

#ea7_term_idObject

Returns the value of attribute ea7_term_id.



3
4
5
# File 'lib/blackbaud-client/api/blackbaud_class.rb', line 3

def ea7_term_id
  @ea7_term_id
end

#ea7_term_nameObject

Returns the value of attribute ea7_term_name.



3
4
5
# File 'lib/blackbaud-client/api/blackbaud_class.rb', line 3

def ea7_term_name
  @ea7_term_name
end

#facultyObject

Returns the value of attribute faculty.



3
4
5
# File 'lib/blackbaud-client/api/blackbaud_class.rb', line 3

def faculty
  @faculty
end

#sectionObject

Returns the value of attribute section.



3
4
5
# File 'lib/blackbaud-client/api/blackbaud_class.rb', line 3

def section
  @section
end

#studentsObject

Returns the value of attribute students.



3
4
5
# File 'lib/blackbaud-client/api/blackbaud_class.rb', line 3

def students
  @students
end

Instance Method Details

#marking_columnsObject



21
22
23
# File 'lib/blackbaud-client/api/blackbaud_class.rb', line 21

def marking_columns
  @client.get_class_marking_columns(self.ea7_class_id)
end