Permalink
Browse files

Adding a more complex example

  • Loading branch information...
1 parent d9e0289 commit fb296b6abb9e05c3ad63ad964ce5d5ae7f138ed1 @reu committed Feb 4, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 README.md
View
@@ -33,6 +33,21 @@ log.command.password.value # => "super secret"
log.date_time.day # => 26
```
+And here goes a very extensive example:
+
+```ruby
+parser = Fonte::Parsers::LogParser.new
+log = parser.parse('"Reu<2><STEAM_1:1:24968171><Blue>" killed "guimello<13><STEAM_1:1:34492580><Red>" with "minigun" (headshot) (attacker_position "3354 -2485 -187") (victim_position "3410 -2518 -149")')
+log.command.value # => "kill"
+log.command.attacker.nickname.value # => "Reu"
+log.command.attacker.team.value # => "Blue"
+log.command.victim.steam_id.value # => "STEAM_1:1:34492580"
+log.command.victim.uid.value # => 13
+log.command.weapon.value # => "minigun"
+log.command.properties.value["headshot"] # => true
+log.command.properties.value["attacker_position"] # => [3354, -2485, -187]
+```
+
## Games it supports
In the current version it can parse all TF2, L4D, CSS and DOD files.

0 comments on commit fb296b6

Please sign in to comment.