Class: PairSee::DateCombo
- Inherits:
-
Object
- Object
- PairSee::DateCombo
- Defined in:
- lib/pair_see/date_combo.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#devs ⇒ Object
readonly
Returns the value of attribute devs.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(date, *devs) ⇒ DateCombo
constructor
A new instance of DateCombo.
- #to_s ⇒ Object
Constructor Details
#initialize(date, *devs) ⇒ DateCombo
Returns a new instance of DateCombo.
5 6 7 8 |
# File 'lib/pair_see/date_combo.rb', line 5 def initialize(date, *devs) @date = date @devs = devs end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
3 4 5 |
# File 'lib/pair_see/date_combo.rb', line 3 def date @date end |
#devs ⇒ Object (readonly)
Returns the value of attribute devs.
3 4 5 |
# File 'lib/pair_see/date_combo.rb', line 3 def devs @devs end |
Instance Method Details
#<=>(other) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/pair_see/date_combo.rb', line 18 def <=>(other) if date && other.date date <=> other.date elsif date 1 elsif other.date -1 else 0 end end |
#to_s ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/pair_see/date_combo.rb', line 10 def to_s if date.nil? "#{devs.join ', '}: not yet" else "#{devs.join ', '}: #{date}" end end |