Class: S3Ranger::Node
- Inherits:
-
Object
- Object
- S3Ranger::Node
- Includes:
- Comparable
- Defined in:
- lib/s3ranger/sync.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#path ⇒ Object
Returns the value of attribute path.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object (also: #eql?)
- #full ⇒ Object
-
#initialize(base, path, size) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(base, path, size) ⇒ Node
Returns a new instance of Node.
77 78 79 80 81 |
# File 'lib/s3ranger/sync.rb', line 77 def initialize base, path, size @base = base.squeeze '/' @path = path.squeeze '/' @size = size end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
73 74 75 |
# File 'lib/s3ranger/sync.rb', line 73 def base @base end |
#path ⇒ Object
Returns the value of attribute path.
74 75 76 |
# File 'lib/s3ranger/sync.rb', line 74 def path @path end |
#size ⇒ Object
Returns the value of attribute size.
75 76 77 |
# File 'lib/s3ranger/sync.rb', line 75 def size @size end |
Instance Method Details
#<=>(other) ⇒ Object
91 92 93 94 95 96 97 98 99 |
# File 'lib/s3ranger/sync.rb', line 91 def <=> other if self.size < other.size -1 elsif self.size > other.size 1 else 0 end end |
#==(other) ⇒ Object Also known as: eql?
87 88 89 |
# File 'lib/s3ranger/sync.rb', line 87 def == other full == other.full and @size == other.size end |