Class: Vatsim::VoiceServer

Inherits:
Object
  • Object
show all
Defined in:
lib/vatsim/voice_server.rb

Overview

Voice server that clients can use

Instance Attribute Summary collapse

Instance Method Summary collapse

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_allowedObject (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_IPObject (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

#locationObject (readonly)

Returns the value of attribute location.



5
6
7
# File 'lib/vatsim/voice_server.rb', line 5

def location
  @location
end

#nameObject (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_serverObject (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