Class: TF2LineParser::Events::BuiltObject
- Defined in:
- lib/tf2_line_parser/events/built_object.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#player ⇒ Object
readonly
Returns the value of attribute player.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Attributes inherited from Event
#airshot, #cap_name, #cap_number, #customkill, #healing, #item, #length, #message, #method, #role, #score, #target, #team, #type, #ubercharge, #unknown, #value, #weapon
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(time, name, uid, steam_id, team, object) ⇒ BuiltObject
constructor
A new instance of BuiltObject.
Methods inherited from Event
parse_player_section, parse_target_section, #parse_time, regex_cap, regex_console, regex_message, regex_player, regex_results, regex_target, regex_time, time_format, types
Constructor Details
#initialize(time, name, uid, steam_id, team, object) ⇒ BuiltObject
Returns a new instance of BuiltObject.
22 23 24 25 26 |
# File 'lib/tf2_line_parser/events/built_object.rb', line 22 def initialize(time, name, uid, steam_id, team, object) @time = parse_time(time) @player = Player.new(name, uid, steam_id, team) @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
4 5 6 |
# File 'lib/tf2_line_parser/events/built_object.rb', line 4 def object @object end |
#player ⇒ Object (readonly)
Returns the value of attribute player.
4 5 6 |
# File 'lib/tf2_line_parser/events/built_object.rb', line 4 def player @player end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
4 5 6 |
# File 'lib/tf2_line_parser/events/built_object.rb', line 4 def time @time end |
Class Method Details
.attributes ⇒ Object
18 19 20 |
# File 'lib/tf2_line_parser/events/built_object.rb', line 18 def self.attributes @attributes ||= %i[time player_section object] end |
.regex ⇒ Object
6 7 8 |
# File 'lib/tf2_line_parser/events/built_object.rb', line 6 def self.regex @regex ||= /#{regex_time} #{regex_player} triggered "(?:player_)?builtobject" #{regex_object_info}#{regex_position}?/.freeze end |
.regex_object_info ⇒ Object
10 11 12 |
# File 'lib/tf2_line_parser/events/built_object.rb', line 10 def self.regex_object_info @regex_object_info ||= '\(object "(?\'object\'[^"]+)"\)' end |
.regex_position ⇒ Object
14 15 16 |
# File 'lib/tf2_line_parser/events/built_object.rb', line 14 def self.regex_position @regex_position ||= / \(position "[^"]+"\)/ end |