Class: FedenaSdk::Attendance
- Defined in:
- lib/fedena_sdk/attendance.rb
Instance Attribute Summary collapse
-
#afternoon ⇒ Object
Returns the value of attribute afternoon.
-
#batch_name ⇒ Object
Returns the value of attribute batch_name.
-
#class_timing_name ⇒ Object
Returns the value of attribute class_timing_name.
-
#date ⇒ Object
Returns the value of attribute date.
-
#forenoon ⇒ Object
Returns the value of attribute forenoon.
-
#reason ⇒ Object
Returns the value of attribute reason.
-
#student_admission_no ⇒ Object
Returns the value of attribute student_admission_no.
-
#subject_code ⇒ Object
Returns the value of attribute subject_code.
Class Method Summary collapse
- .create(*args) ⇒ Object
- .destroy(admission_no, date) ⇒ Object
- .search(query) ⇒ Object
- .show(admission_no, options = {}) ⇒ Object
Instance Method Summary collapse
Methods inherited from Model
attr_accessor, #attributes, #get, get, #initialize, post, #post, request, #request
Constructor Details
This class inherits a constructor from FedenaSdk::Model
Instance Attribute Details
#afternoon ⇒ Object
Returns the value of attribute afternoon.
3 4 5 |
# File 'lib/fedena_sdk/attendance.rb', line 3 def afternoon @afternoon end |
#batch_name ⇒ Object
Returns the value of attribute batch_name.
3 4 5 |
# File 'lib/fedena_sdk/attendance.rb', line 3 def batch_name @batch_name end |
#class_timing_name ⇒ Object
Returns the value of attribute class_timing_name.
3 4 5 |
# File 'lib/fedena_sdk/attendance.rb', line 3 def class_timing_name @class_timing_name end |
#date ⇒ Object
Returns the value of attribute date.
3 4 5 |
# File 'lib/fedena_sdk/attendance.rb', line 3 def date @date end |
#forenoon ⇒ Object
Returns the value of attribute forenoon.
3 4 5 |
# File 'lib/fedena_sdk/attendance.rb', line 3 def forenoon @forenoon end |
#reason ⇒ Object
Returns the value of attribute reason.
3 4 5 |
# File 'lib/fedena_sdk/attendance.rb', line 3 def reason @reason end |
#student_admission_no ⇒ Object
Returns the value of attribute student_admission_no.
3 4 5 |
# File 'lib/fedena_sdk/attendance.rb', line 3 def student_admission_no @student_admission_no end |
#subject_code ⇒ Object
Returns the value of attribute subject_code.
3 4 5 |
# File 'lib/fedena_sdk/attendance.rb', line 3 def subject_code @subject_code end |
Class Method Details
.create(*args) ⇒ Object
37 38 39 40 |
# File 'lib/fedena_sdk/attendance.rb', line 37 def self.create(*args) attendance = Attendance.new *args attendance.save end |
.destroy(admission_no, date) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/fedena_sdk/attendance.rb', line 42 def self.destroy(admission_no, date) url = "/api/attendances/#{admission_no}" params = { date: date } = { params: params } request(:delete, url, ) end |
.search(query) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/fedena_sdk/attendance.rb', line 19 def self.search(query) url = '/api/attendances' params = { search: query } = { params: params } hash = get(url, ) hash['attendance_detail']['attendance'].map do |attendance_hash| new attendance_hash end end |
.show(admission_no, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/fedena_sdk/attendance.rb', line 5 def self.show(admission_no, = {}) date = [:date] attendance_type = [:attendance_type] subject_code = [:subject_code] class_timing_name = [:class_timing_name] url = "/api/attendances/#{admission_no}" = { params: { attendance_type: attendance_type, date: date, subject_code: subject_code, class_timing_name: class_timing_name } } hash = get(url, ) new hash['attendance_detail']['attendance'] end |
Instance Method Details
#attributes_hash ⇒ Object
Overrides
54 55 56 |
# File 'lib/fedena_sdk/attendance.rb', line 54 def attributes_hash super.merge(admission_no: @student_admission_no) end |
#destroy ⇒ Object
49 50 51 |
# File 'lib/fedena_sdk/attendance.rb', line 49 def destroy self.class.destroy(student_admission_no, date) end |
#save ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/fedena_sdk/attendance.rb', line 29 def save url = '/api/attendances' params = attributes_hash = { params: params } hash = post(url, ) new hash['attendance_detail']['attendance'] end |