Class: MultiSync::Resource

Inherits:
Object
  • Object
show all
Includes:
Comparable, Mixins::LogHelper
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

Methods included from Mixins::LogHelper

#class_name

Instance Method Details

#<=>(other) ⇒ Object



54
55
56
# File 'lib/multi_sync/resource.rb', line 54

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

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



58
59
60
# File 'lib/multi_sync/resource.rb', line 58

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

#hashObject



50
51
52
# File 'lib/multi_sync/resource.rb', line 50

def hash
  path_without_root.hash
end

#matching_etag?(other) ⇒ Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/multi_sync/resource.rb', line 63

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