Class: Poly::Period
Constant Summary
Constants included from Poly
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#isLab ⇒ Object
readonly
Returns the value of attribute isLab.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
-
#week ⇒ Object
readonly
Returns the value of attribute week.
-
#weekDay ⇒ Object
readonly
Returns the value of attribute weekDay.
Class Method Summary collapse
Instance Method Summary collapse
- #dates(trimester, week, day) ⇒ Object
-
#initialize(from, to, week, weekDay, group, location, isLab) ⇒ Period
constructor
A new instance of Period.
- #to_s ⇒ Object
Methods included from Poly
#fetch, userConfDir, userConfDir=
Constructor Details
#initialize(from, to, week, weekDay, group, location, isLab) ⇒ Period
Returns a new instance of Period.
9 10 11 12 13 14 15 16 17 |
# File 'lib/polyhoraire/period.rb', line 9 def initialize(from,to,week,weekDay,group,location,isLab) @from = from @to = to @week = week @weekDay = weekDay @group = group @location = location @isLab = isLab end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
7 8 9 |
# File 'lib/polyhoraire/period.rb', line 7 def from @from end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
7 8 9 |
# File 'lib/polyhoraire/period.rb', line 7 def group @group end |
#isLab ⇒ Object (readonly)
Returns the value of attribute isLab.
7 8 9 |
# File 'lib/polyhoraire/period.rb', line 7 def isLab @isLab end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
7 8 9 |
# File 'lib/polyhoraire/period.rb', line 7 def location @location end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
7 8 9 |
# File 'lib/polyhoraire/period.rb', line 7 def to @to end |
#week ⇒ Object (readonly)
Returns the value of attribute week.
7 8 9 |
# File 'lib/polyhoraire/period.rb', line 7 def week @week end |
#weekDay ⇒ Object (readonly)
Returns the value of attribute weekDay.
7 8 9 |
# File 'lib/polyhoraire/period.rb', line 7 def weekDay @weekDay end |
Class Method Details
.from_nokogiri(doc, acronym) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/polyhoraire/period.rb', line 19 def self.from_nokogiri(doc, acronym) nodeSet = doc.xpath("//evenement[sigle = '" + acronym + "']") if nodeSet.nil? || nodeSet.empty? raise ArgumentError else periods = Array.new nodeSet.each do |node| periods.push self.parse_node(node) end return periods end end |
Instance Method Details
#dates(trimester, week, day) ⇒ Object
33 34 35 |
# File 'lib/polyhoraire/period.rb', line 33 def dates(trimester,week,day) return @trimester.week[week][day] end |
#to_s ⇒ Object
37 38 39 40 41 |
# File 'lib/polyhoraire/period.rb', line 37 def to_s puts "---" puts "From : " + @from + " To : " + @to + " On day : " + @weekDay puts "---" end |