Class: OsuRuby::Parser::Section

Inherits:
Object
  • Object
show all
Defined in:
(osu-ruby2 0.0.2) osu-ruby2/parser/content.rb

Overview

A Section dictates a group of string line to be parsed using one Entry class parser.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, str) ⇒ Section

Returns a new instance of Section.

Parameters:

  • name (String)

    section name

  • str (String)

    piece of section to be parsed.

Instance Attribute Details

#contentsArray<Entry> (readonly)

Returns parsed contents.

Returns:

  • (Array<Entry>)

    parsed contents.

#nameString

Returns section name.

Returns:

  • (String)

    section name

Class Method Details

.create(entry_class, &block) ⇒ Object

.entryClass<Entry>

Returns entry class that represents the available parser.

Returns:

  • (Class<Entry>)

    entry class that represents the available parser.

.inherited(cls)

This method returns an undefined value.

Upon inheriting, subclasses can use #entry= function to configure the expected Entry class to parse the strings.

Instance Method Details

#to_sString

Returns section content converted into osu!-compatible string.

Returns:

  • (String)

    section content converted into osu!-compatible string.