Class: Conflict::Conflict

Inherits:
Object
  • Object
show all
Defined in:
lib/conflict/domain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(local, remote) ⇒ Conflict

Returns a new instance of Conflict.

Raises:



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

#localObject (readonly)

Returns the value of attribute local.



22
23
24
# File 'lib/conflict/domain.rb', line 22

def local
  @local
end

#remoteObject (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

Returns:

  • (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_clientObject



35
36
37
# File 'lib/conflict/domain.rb', line 35

def remote_client
  remote.client
end