Class: Circuitry::Topic

Inherits:
Object
  • Object
show all
Defined in:
lib/circuitry/topic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arn) ⇒ Topic

Returns a new instance of Topic.



5
6
7
# File 'lib/circuitry/topic.rb', line 5

def initialize(arn)
  @arn = arn
end

Instance Attribute Details

#arnObject (readonly)

Returns the value of attribute arn.



3
4
5
# File 'lib/circuitry/topic.rb', line 3

def arn
  @arn
end

Instance Method Details

#==(obj) ⇒ Object



13
14
15
# File 'lib/circuitry/topic.rb', line 13

def ==(obj)
  obj.hash == self.hash
end

#hashObject



17
18
19
# File 'lib/circuitry/topic.rb', line 17

def hash
  [self.class, arn].hash
end

#nameObject



9
10
11
# File 'lib/circuitry/topic.rb', line 9

def name
  @name ||= arn.split(':').last
end