Class: AprsIs::Client
- Inherits:
-
Object
- Object
- AprsIs::Client
- Defined in:
- lib/aprs_is/client.rb
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #apply_filter(filter) ⇒ Object
-
#initialize(hostname:, port:, version: "AprsIs::Client v#{VERSION}") ⇒ Client
constructor
A new instance of Client.
- #login(call_sign, filters = []) ⇒ Object
- #read(&block) ⇒ Object
-
#send_message(message) ⇒ Object
:nocov:.
-
#stream(&block) ⇒ Object
:nocov:.
Constructor Details
Instance Attribute Details
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
5 6 7 |
# File 'lib/aprs_is/client.rb', line 5 def hostname @hostname end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
5 6 7 |
# File 'lib/aprs_is/client.rb', line 5 def port @port end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
5 6 7 |
# File 'lib/aprs_is/client.rb', line 5 def version @version end |
Instance Method Details
#apply_filter(filter) ⇒ Object
20 21 22 |
# File 'lib/aprs_is/client.rb', line 20 def apply_filter(filter) ((filter)) end |
#login(call_sign, filters = []) ⇒ Object
15 16 17 18 |
# File 'lib/aprs_is/client.rb', line 15 def login(call_sign, filters = []) ((call_sign, filters)) return self end |
#read(&block) ⇒ Object
24 25 26 27 28 |
# File 'lib/aprs_is/client.rb', line 24 def read(&block) while line = socket.gets yield line end end |
#send_message(message) ⇒ Object
:nocov:
38 39 40 |
# File 'lib/aprs_is/client.rb', line 38 def () socket.puts end |
#stream(&block) ⇒ Object
:nocov:
31 32 33 34 35 |
# File 'lib/aprs_is/client.rb', line 31 def stream(&block) loop do read(&block) end end |