Class: QStat::ServerInfo::Rule
- Inherits:
-
Object
- Object
- QStat::ServerInfo::Rule
- Defined in:
- lib/ruby-qstat.rb
Instance Attribute Summary collapse
-
#bots ⇒ Object
Returns the value of attribute bots.
-
#dedicated ⇒ Object
Returns the value of attribute dedicated.
-
#game_port ⇒ Object
Returns the value of attribute game_port.
-
#game_tag ⇒ Object
Returns the value of attribute game_tag.
-
#gamedir ⇒ Object
Returns the value of attribute gamedir.
-
#gamename ⇒ Object
Returns the value of attribute gamename.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#secure ⇒ Object
Returns the value of attribute secure.
-
#sv_os ⇒ Object
Returns the value of attribute sv_os.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
- #game_tags ⇒ Object
-
#initialize ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize ⇒ Rule
Returns a new instance of Rule.
89 90 |
# File 'lib/ruby-qstat.rb', line 89 def initialize end |
Instance Attribute Details
#bots ⇒ Object
Returns the value of attribute bots.
81 82 83 |
# File 'lib/ruby-qstat.rb', line 81 def bots @bots end |
#dedicated ⇒ Object
Returns the value of attribute dedicated.
82 83 84 |
# File 'lib/ruby-qstat.rb', line 82 def dedicated @dedicated end |
#game_port ⇒ Object
Returns the value of attribute game_port.
86 87 88 |
# File 'lib/ruby-qstat.rb', line 86 def game_port @game_port end |
#game_tag ⇒ Object
Returns the value of attribute game_tag.
87 88 89 |
# File 'lib/ruby-qstat.rb', line 87 def game_tag @game_tag end |
#gamedir ⇒ Object
Returns the value of attribute gamedir.
79 80 81 |
# File 'lib/ruby-qstat.rb', line 79 def gamedir @gamedir end |
#gamename ⇒ Object
Returns the value of attribute gamename.
80 81 82 |
# File 'lib/ruby-qstat.rb', line 80 def gamename @gamename end |
#protocol ⇒ Object
Returns the value of attribute protocol.
78 79 80 |
# File 'lib/ruby-qstat.rb', line 78 def protocol @protocol end |
#secure ⇒ Object
Returns the value of attribute secure.
84 85 86 |
# File 'lib/ruby-qstat.rb', line 84 def secure @secure end |
#sv_os ⇒ Object
Returns the value of attribute sv_os.
83 84 85 |
# File 'lib/ruby-qstat.rb', line 83 def sv_os @sv_os end |
#version ⇒ Object
Returns the value of attribute version.
85 86 87 |
# File 'lib/ruby-qstat.rb', line 85 def version @version end |
Class Method Details
.create_from_xml(doc) ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/ruby-qstat.rb', line 92 def self.create_from_xml(doc) rule = Rule.new rule.protocol = doc.search("rule[name=protocol]").text rule.gamedir = doc.search("rule[name=gamedir]").text rule.gamename = doc.search("rule[name=gamename]").text rule.bots = doc.search("rule[name=bots]").text rule.dedicated = doc.search("rule[name=dedicated]").text rule.sv_os = doc.search("rule[name=sv_os]").text rule.secure = doc.search("rule[name=secure]").text rule.version = doc.search("rule[name=version]").text rule.game_port = doc.search("rule[name=game_port]").text rule.game_tag = doc.search("rule[name=game_tag]").text rule end |
Instance Method Details
#game_tags ⇒ Object
107 108 109 110 111 112 113 |
# File 'lib/ruby-qstat.rb', line 107 def if @game_tag =~ /^.*\n@(.*)$/ $1.split(",") else [] end end |