Class: Vatsim::VoiceServer
- Inherits:
-
Object
- Object
- Vatsim::VoiceServer
- Defined in:
- lib/vatsim/voice_server.rb
Overview
Voice server that clients can use
Instance Attribute Summary collapse
-
#clients_connection_allowed ⇒ Object
readonly
Returns the value of attribute clients_connection_allowed.
-
#hostname_or_IP ⇒ Object
readonly
Returns the value of attribute hostname_or_IP.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type_of_voice_server ⇒ Object
readonly
Returns the value of attribute type_of_voice_server.
Instance Method Summary collapse
-
#initialize(line) ⇒ VoiceServer
constructor
Initialize Server with colon delimited line from vatsim-data.txt format.
Constructor Details
#initialize(line) ⇒ VoiceServer
Initialize Server with colon delimited line from vatsim-data.txt format
8 9 10 11 12 13 14 15 16 |
# File 'lib/vatsim/voice_server.rb', line 8 def initialize line attributes = [:hostname_or_IP, :location, :name, :clients_connection_allowed, :type_of_voice_server] line_split = line.split(":") attributes.each_with_index.map { |attribute, index| instance_variable_set("@#{attribute}", line_split[index]) if self.respond_to?(attribute) } end |
Instance Attribute Details
#clients_connection_allowed ⇒ Object (readonly)
Returns the value of attribute clients_connection_allowed.
5 6 7 |
# File 'lib/vatsim/voice_server.rb', line 5 def clients_connection_allowed @clients_connection_allowed end |
#hostname_or_IP ⇒ Object (readonly)
Returns the value of attribute hostname_or_IP.
5 6 7 |
# File 'lib/vatsim/voice_server.rb', line 5 def hostname_or_IP @hostname_or_IP end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
5 6 7 |
# File 'lib/vatsim/voice_server.rb', line 5 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/vatsim/voice_server.rb', line 5 def name @name end |
#type_of_voice_server ⇒ Object (readonly)
Returns the value of attribute type_of_voice_server.
5 6 7 |
# File 'lib/vatsim/voice_server.rb', line 5 def type_of_voice_server @type_of_voice_server end |