Class: Imgur::Model::Base

Inherits:
Object
  • Object
show all
Defined in:
(ruby-imgur 0.0.1) ruby-imgur/model.rb

Overview

Wildcard model

Direct Known Subclasses

Account, Album, Comment, Gallery, Image

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_objObject?

Returns only return object if it's a wildcard.

Returns:

  • (Object, nil)

    only return object if it's a wildcard.