Class: Vatsim::Server
- Inherits:
-
Object
- Object
- Vatsim::Server
- Defined in:
- lib/vatsim/server.rb
Overview
Server to which clients can connect
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.
-
#ident ⇒ Object
readonly
Returns the value of attribute ident.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(line) ⇒ Server
constructor
Initialize Server with colon delimited line from vatsim-data.txt format.
Constructor Details
#initialize(line) ⇒ Server
Initialize Server with colon delimited line from vatsim-data.txt format
8 9 10 11 12 13 14 15 16 |
# File 'lib/vatsim/server.rb', line 8 def initialize line attributes = [:ident, :hostname_or_IP, :location, :name, :clients_connection_allowed] 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/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/server.rb', line 5 def hostname_or_IP @hostname_or_IP end |
#ident ⇒ Object (readonly)
Returns the value of attribute ident.
5 6 7 |
# File 'lib/vatsim/server.rb', line 5 def ident @ident end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
5 6 7 |
# File 'lib/vatsim/server.rb', line 5 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/vatsim/server.rb', line 5 def name @name end |