Class: LocalIdentifier

Inherits:
Object
  • Object
show all
Defined in:
lib/cirrocumulus/identifier.rb

Overview

Agent identifier for local agents.

Instance Method Summary collapse

Constructor Details

#initialize(ontology_name) ⇒ LocalIdentifier

Returns a new instance of LocalIdentifier.



69
70
71
# File 'lib/cirrocumulus/identifier.rb', line 69

def initialize(ontology_name)
  @ontology_name = ontology_name
end

Instance Method Details

#==(other) ⇒ Object



73
74
75
76
77
# File 'lib/cirrocumulus/identifier.rb', line 73

def ==(other)
  return false if other.nil? || !other.is_a?(LocalIdentifier)

  to_s == other.to_s
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/cirrocumulus/identifier.rb', line 83

def eql?(other)
  self == other
end

#hashObject



79
80
81
# File 'lib/cirrocumulus/identifier.rb', line 79

def hash
  to_s.hash
end

#to_sObject



87
88
89
# File 'lib/cirrocumulus/identifier.rb', line 87

def to_s
  "local-%s" % @ontology_name
end