Class: LocalMessageUser

Inherits:
Object
  • Object
show all
Defined in:
lib/local_message/local_message_user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(port_number, host_name) ⇒ LocalMessageUser

Returns a new instance of LocalMessageUser.



5
6
7
8
# File 'lib/local_message/local_message_user.rb', line 5

def initialize(port_number, host_name)
  @port = port_number
  @hostname = host_name
end

Instance Attribute Details

#hostnameObject (readonly)

Returns the value of attribute hostname.



3
4
5
# File 'lib/local_message/local_message_user.rb', line 3

def hostname
  @hostname
end

#portObject (readonly)

Returns the value of attribute port.



3
4
5
# File 'lib/local_message/local_message_user.rb', line 3

def port
  @port
end

Instance Method Details

#==(other) ⇒ Object



10
11
12
# File 'lib/local_message/local_message_user.rb', line 10

def ==(other)
  hostname == other.hostname
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/local_message/local_message_user.rb', line 14

def eql?(other)
  self == other
end

#hashObject



18
19
20
# File 'lib/local_message/local_message_user.rb', line 18

def hash
  hostname.hash
end