Module: X::Objects::Lookups::Lists

Included in:
API
Defined in:
x-objects/lib/x/objects/lookups/lists.rb

Overview

Look up lists, mixed into a client through API

Internal to x-objects: X::Objects::API includes it, and its methods are public API of the client that includes API, but the module is only how they are grouped, and some of them need the methods of another, so include API rather than this module alone.

Instance Method Summary collapse

Instance Method Details

#find_list(id, **params) {|problem| ... } ⇒ List?

Look up a list by identifier

Examples:

Look up a list

client.find_list(1234567890).name

Parameters:

  • id (String, Integer, List) —

    the identifier

  • params (Hash) —

    query parameters merged over the default parameters

Yield Parameters:

  • problem (Problem) —

    each problem the API reported, such as a resource that was not found

Returns:

  • (List, nil) —

    the list or nil if the list was not found



25
26
27
# File 'x-objects/lib/x/objects/lookups/lists.rb', line 25

def find_list(id, **params, &)
  List.find(id, client: self, **params, &)
end

#find_list!(id, **params) ⇒ List

Look up a list by identifier, which must exist

Examples:

Look up a list

client.find_list!(1234567890).name

Parameters:

  • id (String, Integer, List) —

    the identifier

  • params (Hash) —

    query parameters merged over the default parameters

Returns:

  • (List) —

    the list

Raises:



38
39
40
# File 'x-objects/lib/x/objects/lookups/lists.rb', line 38

def find_list!(id, **params)
  List.find!(id, client: self, **params)
end