Class: OsuRuby::Parser::Base
- Inherits:
-
Object
- Object
- OsuRuby::Parser::Base
- Defined in:
- (osu-ruby2 0.0.2) osu-ruby2/parser/base.rb
Overview
Base-class for parsing human editable text-file related to osu! content.
Parser Sekelton uses 3 functionality to work.
-
Reader, text file to machine variables conversion. Uses Section and Entry to help.
-
Writer, machine variables to text file. Make a use of #compile_contents and Section#to_s.
-
Converter, passes machine variables into Behavior specific container that accepts given variables. See #convert
These functionality defines on how parser works in general and will be implemented in detail by its subclasses.
Direct Known Subclasses
Class Method Summary collapse
-
.load(fn) ⇒ Base
parse file from given filename.
Instance Method Summary collapse
-
#compile_contents ⇒ String
abstract
compiles editable contents into an osu!-supported strings.
- #convert(obj = nil) ⇒ Object abstract
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #parse(io) abstract
- #write(file)
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
Class Method Details
.load(fn) ⇒ Base
All IO variables retrieved from this method always closed after parsing.
parse file from given filename
Instance Method Details
#compile_contents ⇒ String
Section compilation implmenetations are handled by subclasses.
compiles editable contents into an osu!-supported strings.
#convert ⇒ Object #convert(obj) ⇒ Object
This is only to document how convert
function expected to work. Further implementations are handled by its subclasses.
#parse(io)
parse given IO input to program editable contents
This method returns an undefined value.
#write(fn) #write(io)
This method returns an undefined value.