Module: Ecoportal::API::Common::Content::CollectionModel::Model::NumericKey::InstanceMethods

Defined in:
lib/ecoportal/api/common/content/collection_model/model/numeric_key.rb

Overview

INSTANCE METHODS

Instance Method Summary collapse

Instance Method Details

#get_key(value) ⇒ String

Note:

its name could be fetch_key.

Gets the key value of the object value.

Returns:

  • (String)

    the value of the key on the object value.



27
28
29
30
31
32
# File 'lib/ecoportal/api/common/content/collection_model/model/numeric_key.rb', line 27

def get_key(value)
  return super unless value.is_a?(Numeric)

  # get_key(_items[value])

  get_key(to_a[value])
end