Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

rummelonp/gotaku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gotaku

Gotaku is a 5tq parser.

INSTALL

$ gem install gotaku

EXAMPLE

require 'gotaku'

gotaku = Gotaku.parse './data.5tq'

gotaku.verify?          # => true
gotaku.headers.length   # => 8
gotaku.questions.length # => 64

header = gotaku.headers.first
header.verify? # => true
header.index   # => 0
header.type    # => "Genre 1"
header.file    # => "TEST.5TD"
header.code    # => "5TAKUQDX"

question = gotaku.questions.first
question.genre   # => 0
question.index   # => 0
question.message # => "Some question"
question.choices # => ["Choice 1", "Choice 2", "Choice 3", "Choice 4", "Choice 5"]

question = gotaku.questions.last
question.genre   # => 7
question.index   # => 7

gotaku.to_xml # =>
<?xml version="1.0" encoding="UTF-8"?>
<gotaku>
  <headers>
...

Copyright © 2011 Kazuya Takeshima

Released under the GNU Lesser General Public License: www.gnu.org/licenses/lgpl.html