Class: Osm::Register::Attendance
Constant Summary collapse
- SORT_BY =
[:section_id, :grouping_id, :last_name, :first_name]
Instance Attribute Summary collapse
-
#attendance ⇒ Hash
The data for each field - keys are the date, values one of :yes, :unadvised_absent or :advised_absent.
-
#first_name ⇒ String
The member’s first name.
-
#grouping_id ⇒ Fixnum
The OSM ID for the member’s grouping.
-
#last_name ⇒ String
The member’s last name.
-
#member_id ⇒ Fixnum
The OSM ID for the member.
-
#section_id ⇒ Fixnum
The OSM ID for the member’s section.
-
#total ⇒ FixNum
Total.
Instance Method Summary collapse
-
#absent_on?(date) ⇒ Boolean
Find out if the member was absent on a date.
-
#initialize ⇒ Object
constructor
Initialize a new registerData.
-
#present_on?(date) ⇒ Boolean
Find out if the member was present on a date.
Methods inherited from Model
#<, #<=, #<=>, #>, #>=, #between?, #changed_attributes, configure, #reset_changed_attributes, #to_i
Constructor Details
#initialize ⇒ Object
Initialize a new registerData
|
# File 'lib/osm/register.rb', line 204
|
Instance Attribute Details
#attendance ⇒ Hash
Returns The data for each field - keys are the date, values one of :yes, :unadvised_absent or :advised_absent.
182 |
# File 'lib/osm/register.rb', line 182 attribute :member_id, :type => Integer |
#first_name ⇒ String
Returns The member’s first name.
182 |
# File 'lib/osm/register.rb', line 182 attribute :member_id, :type => Integer |
#grouping_id ⇒ Fixnum
Returns The OSM ID for the member’s grouping.
182 |
# File 'lib/osm/register.rb', line 182 attribute :member_id, :type => Integer |
#last_name ⇒ String
Returns The member’s last name.
182 |
# File 'lib/osm/register.rb', line 182 attribute :member_id, :type => Integer |
#member_id ⇒ Fixnum
Returns The OSM ID for the member.
182 |
# File 'lib/osm/register.rb', line 182 attribute :member_id, :type => Integer |
#section_id ⇒ Fixnum
Returns The OSM ID for the member’s section.
182 |
# File 'lib/osm/register.rb', line 182 attribute :member_id, :type => Integer |
#total ⇒ FixNum
Returns Total.
182 |
# File 'lib/osm/register.rb', line 182 attribute :member_id, :type => Integer |
Instance Method Details
#absent_on?(date) ⇒ Boolean
Find out if the member was absent on a date
219 220 221 |
# File 'lib/osm/register.rb', line 219 def absent_on?(date) attendance[date] != :yes end |
#present_on?(date) ⇒ Boolean
Find out if the member was present on a date
212 213 214 |
# File 'lib/osm/register.rb', line 212 def present_on?(date) attendance[date] == :yes end |