Class: OsuAPI::Model::Base

Inherits:
Object
  • Object
show all
Defined in:
(osu-api 0.1.0) osu-api/model.rb

Overview

Wildcard model

Constant Summary collapse

MODEL_KEYS =

List of model expected keys. Leaving this blank will treat the model as wildcard.

%i().freeze

Instance Method Summary collapse

Constructor Details

#initialize(hash_data) ⇒ Base #initialize(any_data) ⇒ Base

Processes model input.

Overloads:

  • #initialize(hash_data) ⇒ Base
    Note:

    this does not guarantee the data to be processed as MODEL_KEYS variable need to be defined and not empty for given class.

    Parameters:

    • hash_data (Hash) —

      response data to be processed.

  • #initialize(any_data) ⇒ Base
    Note:

    this form won't process the data.

    Parameters:

    • any_data (Object) —

      response data

Instance Method Details

#to_obj ⇒ Object?

Returns only return object if it's a wildcard.

Returns:

  • (Object, nil) —

    only return object if it's a wildcard.