Class: Synco::Command::Rotation
- Inherits:
-
Object
- Object
- Synco::Command::Rotation
- Includes:
- Comparable
- Defined in:
- lib/synco/command/prune.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
Sort in reverse order by default.
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(path, time) ⇒ Rotation
constructor
A new instance of Rotation.
- #to_s ⇒ Object
Constructor Details
#initialize(path, time) ⇒ Rotation
Returns a new instance of Rotation.
37 38 39 40 |
# File 'lib/synco/command/prune.rb', line 37 def initialize(path, time) @path = path @time = time end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
43 44 45 |
# File 'lib/synco/command/prune.rb', line 43 def path @path end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
42 43 44 |
# File 'lib/synco/command/prune.rb', line 42 def time @time end |
Instance Method Details
#<=>(other) ⇒ Object
Sort in reverse order by default
46 47 48 |
# File 'lib/synco/command/prune.rb', line 46 def <=> other other.time <=> @time end |
#eql?(other) ⇒ Boolean
50 51 52 53 54 55 56 57 |
# File 'lib/synco/command/prune.rb', line 50 def eql? other case other when Rotation @path.eql?(other.path) else @path.eql?(other.to_s) end end |
#hash ⇒ Object
59 60 61 |
# File 'lib/synco/command/prune.rb', line 59 def hash @path.hash end |
#to_s ⇒ Object
63 64 65 |
# File 'lib/synco/command/prune.rb', line 63 def to_s @path end |