Class: Conflict::Conflict
- Inherits:
-
Object
- Object
- Conflict::Conflict
- Defined in:
- lib/conflict/domain.rb
Instance Attribute Summary collapse
-
#local ⇒ Object
readonly
Returns the value of attribute local.
-
#remote ⇒ Object
readonly
Returns the value of attribute remote.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
-
#initialize(local, remote) ⇒ Conflict
constructor
A new instance of Conflict.
- #remote_client ⇒ Object
Constructor Details
#initialize(local, remote) ⇒ Conflict
Returns a new instance of Conflict.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/conflict/domain.rb', line 24 def initialize local, remote raise ConflictException::new("local event cannot be nil") if local.nil? raise ConflictException::new("remote event cannot be nil") if remote.nil? raise ConflictException::new("local resource '" + local.resource + "' does not match remote resource '" + remote.resource + "'") if ! local.resource.eql?(remote.resource) raise ConflictException::new("local and remote cannot have the same identity") if local == remote #what about = names, not = resources? raise ConflictException::new("local and remote cannot be eql") if local.eql?(remote) # using clone because I may have to write a parser in .net @local, @remote = local.clone, remote.clone end |
Instance Attribute Details
#local ⇒ Object (readonly)
Returns the value of attribute local.
22 23 24 |
# File 'lib/conflict/domain.rb', line 22 def local @local end |
#remote ⇒ Object (readonly)
Returns the value of attribute remote.
22 23 24 |
# File 'lib/conflict/domain.rb', line 22 def remote @remote end |
Instance Method Details
#eql?(other) ⇒ Boolean
39 40 41 |
# File 'lib/conflict/domain.rb', line 39 def eql? other @local.eql?(other.local) and @remote.eql?(other.remote) end |
#remote_client ⇒ Object
35 36 37 |
# File 'lib/conflict/domain.rb', line 35 def remote_client remote.client end |