Class: Hooray::Port

Inherits:
Struct
  • Object
show all
Defined in:
lib/hooray/port.rb

Overview

Socket Port

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/hooray/port.rb', line 5

def name
  @name
end

#numberObject

Returns the value of attribute number

Returns:

  • (Object)

    the current value of number



5
6
7
# File 'lib/hooray/port.rb', line 5

def number
  @number
end

#protocolObject

Returns the value of attribute protocol

Returns:

  • (Object)

    the current value of protocol



5
6
7
# File 'lib/hooray/port.rb', line 5

def protocol
  @protocol
end

Instance Method Details

#<=>(other) ⇒ Object



10
11
12
# File 'lib/hooray/port.rb', line 10

def <=>(other)
  number <=> other.number
end

#to_sObject



14
15
16
# File 'lib/hooray/port.rb', line 14

def to_s
  "#{number}/#{protocol}"
end