Class: Circuitry::Topic

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

Defined Under Namespace

Classes: Finder

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arn) ⇒ Topic

Returns a new instance of Topic.



23
24
25
# File 'lib/circuitry/topic.rb', line 23

def initialize(arn)
  @arn = arn
end

Instance Attribute Details

#arnObject (readonly)

Returns the value of attribute arn.



21
22
23
# File 'lib/circuitry/topic.rb', line 21

def arn
  @arn
end

Class Method Details

.find(name) ⇒ Object



27
28
29
# File 'lib/circuitry/topic.rb', line 27

def self.find(name)
  new(Finder.new(name).find.topic_arn)
end

Instance Method Details

#==(other) ⇒ Object



35
36
37
# File 'lib/circuitry/topic.rb', line 35

def ==(other)
  other.hash == hash
end

#hashObject



39
40
41
# File 'lib/circuitry/topic.rb', line 39

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

#nameObject



31
32
33
# File 'lib/circuitry/topic.rb', line 31

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