Class: LocalMessageUser
- Inherits:
-
Object
- Object
- LocalMessageUser
- Defined in:
- lib/local_message/local_message_user.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(port_number, host_name) ⇒ LocalMessageUser
constructor
A new instance of LocalMessageUser.
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
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
3 4 5 |
# File 'lib/local_message/local_message_user.rb', line 3 def hostname @hostname end |
#port ⇒ Object (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
14 15 16 |
# File 'lib/local_message/local_message_user.rb', line 14 def eql?(other) self == other end |
#hash ⇒ Object
18 19 20 |
# File 'lib/local_message/local_message_user.rb', line 18 def hash hostname.hash end |