Class: S3Sync::Node

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/s3sync/sync.rb

Constant Summary collapse

SMALL_FILE =

50.kilobytes

50 * 1024

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base, path, size, small_comparator = nil) ⇒ Node

Returns a new instance of Node.



81
82
83
84
85
86
# File 'lib/s3sync/sync.rb', line 81

def initialize base, path, size, small_comparator = nil
  @base = base
  @path = path
  @size = size
  @small_comparator = small_comparator
end

Instance Attribute Details

#baseObject

Returns the value of attribute base.



76
77
78
# File 'lib/s3sync/sync.rb', line 76

def base
  @base
end

#pathObject

Returns the value of attribute path.



77
78
79
# File 'lib/s3sync/sync.rb', line 77

def path
  @path
end

#sizeObject

Returns the value of attribute size.



78
79
80
# File 'lib/s3sync/sync.rb', line 78

def size
  @size
end

#small_comparatorObject

Returns the value of attribute small_comparator.



79
80
81
# File 'lib/s3sync/sync.rb', line 79

def small_comparator
  @small_comparator
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



92
93
94
# File 'lib/s3sync/sync.rb', line 92

def == other
  @size == other.size && compare_small_comparators(other)
end

#fullObject



88
89
90
# File 'lib/s3sync/sync.rb', line 88

def full
  S3Sync.safe_join [@base, @path]
end