Class: Operto::Staff::Index

Inherits:
Object
  • Object
show all
Includes:
Operation
Defined in:
lib/operto/staff/index.rb,
sig/operto.rbs

Constant Summary collapse

DEFAULT_PAGE_SIZE =
100

Instance Method Summary collapse

Methods included from Operation

#call!, included

Instance Method Details

#call(skip: 0, take: DEFAULT_PAGE_SIZE) ⇒ ::Dry::Monads::Result[::Hash[::Symbol, untyped]]

RBS:

  • (?skip: ::Integer, ?take: ::Integer) -> Dry::Monads::Result[::Hash[::Symbol, untyped]]

Parameters:

  • skip: (::Integer) (defaults to: 0)
  • take: (::Integer) (defaults to: DEFAULT_PAGE_SIZE)

Returns:

  • (::Dry::Monads::Result[::Hash[::Symbol, untyped]])


9
10
11
12
13
14
15
# File 'lib/operto/staff/index.rb', line 9

def call(skip: 0, take: DEFAULT_PAGE_SIZE)
  query_params = build_query_params(skip, take)
  response = Operto::Client.connection.get('staff', query_params)
  Operto::Client.handle_response(response) { |body| format_results(body) }
rescue StandardError => e
  Failure(e)
end