Class: Tableau::Class
- Inherits:
-
Object
- Object
- Tableau::Class
- Defined in:
- lib/tableau/class.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#day ⇒ Object
Returns the value of attribute day.
-
#intervals ⇒ Object
Returns the value of attribute intervals.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#time ⇒ Object
Returns the value of attribute time.
-
#tutor ⇒ Object
Returns the value of attribute tutor.
-
#type ⇒ Object
Returns the value of attribute type.
-
#weeks ⇒ Object
Returns the value of attribute weeks.
Instance Method Summary collapse
- #defaults ⇒ Object
-
#duration ⇒ Object
Duration of the class in hours.
-
#initialize(day, time, options = {}) ⇒ Class
constructor
A new instance of Class.
Constructor Details
#initialize(day, time, options = {}) ⇒ Class
Returns a new instance of Class.
21 22 23 24 25 26 |
# File 'lib/tableau/class.rb', line 21 def initialize(day, time, = {}) @day = day @time = time @weeks = Array.new defaults.merge!() end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
4 5 6 |
# File 'lib/tableau/class.rb', line 4 def code @code end |
#day ⇒ Object
Returns the value of attribute day.
4 5 6 |
# File 'lib/tableau/class.rb', line 4 def day @day end |
#intervals ⇒ Object
Returns the value of attribute intervals.
4 5 6 |
# File 'lib/tableau/class.rb', line 4 def intervals @intervals end |
#location ⇒ Object
Returns the value of attribute location.
4 5 6 |
# File 'lib/tableau/class.rb', line 4 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/tableau/class.rb', line 4 def name @name end |
#time ⇒ Object
Returns the value of attribute time.
4 5 6 |
# File 'lib/tableau/class.rb', line 4 def time @time end |
#tutor ⇒ Object
Returns the value of attribute tutor.
4 5 6 |
# File 'lib/tableau/class.rb', line 4 def tutor @tutor end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/tableau/class.rb', line 4 def type @type end |
#weeks ⇒ Object
Returns the value of attribute weeks.
4 5 6 |
# File 'lib/tableau/class.rb', line 4 def weeks @weeks end |
Instance Method Details
#defaults ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/tableau/class.rb', line 8 def defaults def_opts = { type: '', location: '', name: '', tutor: '', intervals: 4, day: 0, code: 0, time: Time.new } end |
#duration ⇒ Object
Duration of the class in hours
29 30 31 |
# File 'lib/tableau/class.rb', line 29 def duration @intervals / 4 end |