Module: WeightedListRank::List

Defined in:
lib/weighted_list_rank/list.rb

Instance Method Summary collapse

Instance Method Details

#idInteger, String

Returns the unique identifier of the list. Must be implemented by including class.

Returns:

  • (Integer, String)

    the unique identifier of the list

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/weighted_list_rank/list.rb', line 17

def id
  raise NotImplementedError, "Implement this method to return the unique identifier of a list"
end

#itemsEnumerable<Item>

Returns an enumerable collection of items in the list. Must be implemented by including class.

Returns:

  • (Enumerable<Item>)

    the items within the list

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/weighted_list_rank/list.rb', line 11

def items
  raise NotImplementedError, "Implement this method to return the enumerable collection of items"
end

#weightNumeric

Returns the weight of the list. Must be implemented by including class.

Returns:

  • (Numeric)

    the weight of the list

Raises:

  • (NotImplementedError)


5
6
7
# File 'lib/weighted_list_rank/list.rb', line 5

def weight
  raise NotImplementedError, "Implement this method to return the list's weight"
end