Class: SimplePublisher::Topic

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Topic

Returns a new instance of Topic.



5
6
7
8
9
# File 'lib/simple_publisher/topic.rb', line 5

def initialize(attributes = {})
  attributes.each do |attr, value|
    send("#{attr}=", value)
  end
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/simple_publisher/topic.rb', line 11

def ==(other)
  case other
  when Topic
    other.name == self.name
  else
    false
  end
end