Class: Synco::Command::Rotation

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/synco/command/prune.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (readonly)

Returns the value of attribute path.



43
44
45
# File 'lib/synco/command/prune.rb', line 43

def path
  @path
end

#timeObject (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

Returns:

  • (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

#hashObject



59
60
61
# File 'lib/synco/command/prune.rb', line 59

def hash
	@path.hash
end

#to_sObject



63
64
65
# File 'lib/synco/command/prune.rb', line 63

def to_s
	@path
end