Class: Slot
- Inherits:
-
Object
- Object
- Slot
- Defined in:
- lib/gthc/olson/slot.rb
Overview
Slots objects make up the ScheduleGrid input.
Instance Attribute Summary collapse
-
#col ⇒ Object
Returns the value of attribute col.
-
#endDate ⇒ Object
Returns the value of attribute endDate.
-
#ids ⇒ Object
Returns the value of attribute ids.
-
#isNight ⇒ Object
Returns the value of attribute isNight.
-
#personID ⇒ Object
Returns the value of attribute personID.
-
#phase ⇒ Object
Returns the value of attribute phase.
-
#row ⇒ Object
Returns the value of attribute row.
-
#startDate ⇒ Object
Returns the value of attribute startDate.
-
#status ⇒ Object
Returns the value of attribute status.
-
#weight ⇒ Object
Returns the value of attribute weight.
Class Method Summary collapse
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(personID, startDate, endDate, phase, isNight, status, row, col, weight = 1) ⇒ Slot
constructor
A new instance of Slot.
- #to_hash ⇒ Object
Constructor Details
#initialize(personID, startDate, endDate, phase, isNight, status, row, col, weight = 1) ⇒ Slot
Returns a new instance of Slot.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gthc/olson/slot.rb', line 12 def initialize(personID, startDate, endDate, phase, isNight, status, row, col, weight=1) @personID = personID @startDate = startDate @endDate = endDate @phase = phase @isNight = isNight @status = status @row = row @col = col @weight = 1 @ids = nil end |
Instance Attribute Details
#col ⇒ Object
Returns the value of attribute col.
4 5 6 |
# File 'lib/gthc/olson/slot.rb', line 4 def col @col end |
#endDate ⇒ Object
Returns the value of attribute endDate.
4 5 6 |
# File 'lib/gthc/olson/slot.rb', line 4 def endDate @endDate end |
#ids ⇒ Object
Returns the value of attribute ids.
4 5 6 |
# File 'lib/gthc/olson/slot.rb', line 4 def ids @ids end |
#isNight ⇒ Object
Returns the value of attribute isNight.
4 5 6 |
# File 'lib/gthc/olson/slot.rb', line 4 def isNight @isNight end |
#personID ⇒ Object
Returns the value of attribute personID.
4 5 6 |
# File 'lib/gthc/olson/slot.rb', line 4 def personID @personID end |
#phase ⇒ Object
Returns the value of attribute phase.
4 5 6 |
# File 'lib/gthc/olson/slot.rb', line 4 def phase @phase end |
#row ⇒ Object
Returns the value of attribute row.
4 5 6 |
# File 'lib/gthc/olson/slot.rb', line 4 def row @row end |
#startDate ⇒ Object
Returns the value of attribute startDate.
4 5 6 |
# File 'lib/gthc/olson/slot.rb', line 4 def startDate @startDate end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/gthc/olson/slot.rb', line 4 def status @status end |
#weight ⇒ Object
Returns the value of attribute weight.
4 5 6 |
# File 'lib/gthc/olson/slot.rb', line 4 def weight @weight end |
Class Method Details
.attr_accessor(*vars) ⇒ Object
31 32 33 34 35 |
# File 'lib/gthc/olson/slot.rb', line 31 def self.attr_accessor(*vars) @attributes ||= [] @attributes.concat vars super(*vars) end |
.attributes ⇒ Object
37 38 39 |
# File 'lib/gthc/olson/slot.rb', line 37 def self.attributes @attributes end |
Instance Method Details
#attributes ⇒ Object
41 42 43 |
# File 'lib/gthc/olson/slot.rb', line 41 def attributes self.class.attributes end |
#to_hash ⇒ Object
25 26 27 28 29 |
# File 'lib/gthc/olson/slot.rb', line 25 def to_hash hash = {} instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) } hash end |