Method: ESP::StatSignature.for_stat

Defined in:
lib/esp/resources/stat_signature.rb

.for_stat(stat_id = nil, options = {}) ⇒ ActiveResource::PaginatedCollection<ESP::StatSignature>

Returns a paginated collection of signature stats for the given stat_id Convenience method to use instead of find since a stat_id is required to return signature stats.

Examples:

stats = ESP::StatSignature.for_stat(1194)

Parameters:

  • stat_id (Integer, Numeric) (defaults to: nil)

    Required ID of the stat to list signature stats for.

  • options (Hash) (defaults to: {})

    Optional hash of options.

    Valid Options

    include | The list of associated objects to return on the initial request.

    valid Includable Associations

    See API documentation for valid arguments

Returns:

Raises:

  • (ArgumentError)

    if no stat_id is supplied.



33
34
35
36
37
# File 'lib/esp/resources/stat_signature.rb', line 33

def self.for_stat(stat_id = nil, options = {}) # rubocop:disable Style/OptionHash
  fail ArgumentError, "You must supply a stat id." unless stat_id.present?
  from = "#{prefix}stats/#{stat_id}/signatures.json"
  find(:all, from: from, params: options)
end