Class: MultiSync::Resource

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/multi_sync/resource.rb

Direct Known Subclasses

LocalResource, RemoteResource

Constant Summary collapse

AWS_ATTRIBUTES =
[{
  name: :storage_class,
  type: String,
  default: 'STANDARD'
}, {
  name: :acl,
  type: String,
  default: 'public-read'
}, {
  name: :expires,
  type: String,
  required: false
}, {
  name: :cache_control,
  type: String,
  required: false
}, {
  name: :encryption,
  type: String,
  required: false
}]

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



52
53
54
# File 'lib/multi_sync/resource.rb', line 52

def <=>(other)
  path_without_root <=> other.path_without_root
end

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



56
57
58
# File 'lib/multi_sync/resource.rb', line 56

def ==(other)
  path_without_root == other.path_without_root
end

#hashObject



48
49
50
# File 'lib/multi_sync/resource.rb', line 48

def hash
  path_without_root.hash
end

#matching_etag?(other) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/multi_sync/resource.rb', line 61

def matching_etag?(other)
  etag == other.etag
end