Class: OsuRuby::Parser::SplitEntry Abstract

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

Overview

This class is abstract.

This is an abstract class of Separator-Split Parser

Direct Known Subclasses

BarSplitEntry, ColonSplitEntry, CommaSplitEntry

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entry

#comment?, condition, determine, register_checker

Methods included from Interface::MultiplexerInterface

extended

Constructor Details

#initialize(str) ⇒ SplitEntry

Splits string based on class splitter.

Parameters:

  • str (String)

Class Method Details

.method_added(meth)

This method returns an undefined value.

automatically private methods for #_upcast and #_downcast.

.splitterString

obtain the class splitter.

Returns:

  • (String)

.splitter=(sep)

This method returns an undefined value.

configures the class splitter.

Parameters:

  • sep (String)

    string separator.

Instance Method Details

#[](key) ⇒ Integer, ...

Note:

It's not advised to use negative index as it may lead to unwanted behavior upon upcasting.

access the splitter indices

Parameters:

  • key (Integer)

    index of the array.

Returns:

  • (Integer, Float)

    value after upcasted from String.

  • (String)

    retrieves the string back if the conversion fails.

#[]=(key, value)

This method returns an undefined value.

assigns value to the array

Parameters:

  • key (Integer)

    index of the array

  • value (Object)

    value to be insereted. This value will be converted into a String.

#to_sString

Returns:

  • (String)