Class: Applyrics::StringsFile
- Inherits:
-
Object
- Object
- Applyrics::StringsFile
- Defined in:
- lib/applyrics/stringsfile.rb
Defined Under Namespace
Classes: Parser
Instance Method Summary collapse
- #hash ⇒ Object
- #have_key? ⇒ Boolean
-
#initialize(filename, data = nil) ⇒ StringsFile
constructor
A new instance of StringsFile.
- #keys ⇒ Object
- #read ⇒ Object
- #string_for_key(key) ⇒ Object
Constructor Details
#initialize(filename, data = nil) ⇒ StringsFile
Returns a new instance of StringsFile.
5 6 7 8 9 10 11 |
# File 'lib/applyrics/stringsfile.rb', line 5 def initialize(filename, data=nil) @filename = filename @hash = data.nil? ? {} : data if data.nil? read end end |
Instance Method Details
#hash ⇒ Object
32 33 34 |
# File 'lib/applyrics/stringsfile.rb', line 32 def hash @hash end |
#have_key? ⇒ Boolean
24 25 26 |
# File 'lib/applyrics/stringsfile.rb', line 24 def have_key? # Not implemented... end |
#keys ⇒ Object
20 21 22 |
# File 'lib/applyrics/stringsfile.rb', line 20 def keys # Not implemented... end |
#read ⇒ Object
13 14 15 16 17 18 |
# File 'lib/applyrics/stringsfile.rb', line 13 def read @hash = {} parser = Parser.new(@hash) File.open(@filename, 'rb:utf-16LE:utf-8') { |fd| parser.parse fd } self end |
#string_for_key(key) ⇒ Object
28 29 30 |
# File 'lib/applyrics/stringsfile.rb', line 28 def string_for_key(key) # Not implemented... end |