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.
22 23 24 25 |
# File 'lib/synco/command/prune.rb', line 22 def initialize(path, time) @path = path @time = time end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
28 29 30 |
# File 'lib/synco/command/prune.rb', line 28 def path @path end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
27 28 29 |
# File 'lib/synco/command/prune.rb', line 27 def time @time end |
Instance Method Details
#<=>(other) ⇒ Object
Sort in reverse order by default
31 32 33 |
# File 'lib/synco/command/prune.rb', line 31 def <=> other other.time <=> @time end |
#eql?(other) ⇒ Boolean
35 36 37 38 39 40 41 42 |
# File 'lib/synco/command/prune.rb', line 35 def eql? other case other when Rotation @path.eql?(other.path) else @path.eql?(other.to_s) end end |
#hash ⇒ Object
44 45 46 |
# File 'lib/synco/command/prune.rb', line 44 def hash @path.hash end |
#to_s ⇒ Object
48 49 50 |
# File 'lib/synco/command/prune.rb', line 48 def to_s @path end |