Class: WeekdayNum
- Inherits:
-
Object
- Object
- WeekdayNum
- Defined in:
- lib/weekday_num.rb
Instance Method Summary collapse
- #==(weekdaynum) ⇒ Object
-
#initialize(*args) ⇒ WeekdayNum
constructor
Initializes a WeekdayNum objects.
- #to_ical ⇒ Object
- #to_java ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ WeekdayNum
Initializes a WeekdayNum objects. It accepts a Java WeekdayNum object (com.google.ical.values.WeekdayNum) or the number of the week and the day of the week
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/weekday_num.rb', line 10 def initialize(*args) if args.size == 1 @weekdaynum = args[0] elsif args.size == 2 num = args[0] wday = args[1] @weekdaynum = JWeekdayNum.new(num, Weekday::MAP[wday.to_s.downcase]) end self end |
Instance Method Details
#==(weekdaynum) ⇒ Object
29 30 31 |
# File 'lib/weekday_num.rb', line 29 def ==(weekdaynum) @weekdaynum.equals(weekdaynum.to_java) end |
#to_ical ⇒ Object
21 22 23 |
# File 'lib/weekday_num.rb', line 21 def to_ical @weekdaynum.toIcal end |
#to_java ⇒ Object
33 34 35 |
# File 'lib/weekday_num.rb', line 33 def to_java @weekdaynum end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/weekday_num.rb', line 25 def to_s @weekdaynum.toString end |