Class: Quaff::Source
- Inherits:
-
Object
- Object
- Quaff::Source
- Defined in:
- lib/sources.rb
Overview
A Source is an abstraction representing an IP address/port/transport where a SIP message originates from or can be sent to. It allows users to abstract over TCP and UDP sockets.
Instance Attribute Summary collapse
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#sock ⇒ Object
readonly
Returns the value of attribute sock.
-
#transport ⇒ Object
readonly
Returns the value of attribute transport.
Instance Method Summary collapse
-
#close(cxn) ⇒ Object
Designed to be overriden by subclasses.
- #to_s ⇒ Object
Instance Attribute Details
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
7 8 9 |
# File 'lib/sources.rb', line 7 def ip @ip end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
7 8 9 |
# File 'lib/sources.rb', line 7 def port @port end |
#sock ⇒ Object (readonly)
Returns the value of attribute sock.
7 8 9 |
# File 'lib/sources.rb', line 7 def sock @sock end |
#transport ⇒ Object (readonly)
Returns the value of attribute transport.
7 8 9 |
# File 'lib/sources.rb', line 7 def transport @transport end |
Instance Method Details
#close(cxn) ⇒ Object
Designed to be overriden by subclasses
10 11 |
# File 'lib/sources.rb', line 10 def close cxn end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/sources.rb', line 13 def to_s "#{@ip}:#{@port} (#{@transport})" end |