Class: HaveAPI::Actions::Default::Index

Inherits:
HaveAPI::Action show all
Includes:
Paginable
Defined in:
lib/haveapi/actions/default.rb

Direct Known Subclasses

Resources::ActionState::Index

Instance Attribute Summary

Attributes inherited from HaveAPI::Action

#current_user, #errors, #flags, #message, #request, #version

Instance Method Summary collapse

Methods included from Paginable

included

Methods inherited from HaveAPI::Action

add_pre_authorize_blocks, authorize, #authorized?, build_route, delayed_inherited, describe, example, #exec, from_context, inherit_attrs_from_resource, inherited, #initialize, initialize, input, #input, meta, #meta, model_adapter, output, #params, #prepare, resolve_path_params, #safe_exec, #safe_output, #set_meta, #v?, #validate!, validate_build

Methods included from Hookable

included

Methods inherited from Common

check_build, has_attr, inherit_attrs

Constructor Details

This class inherits a constructor from HaveAPI::Action

Instance Method Details

#countObject

Return the total count of items.



29
# File 'lib/haveapi/actions/default.rb', line 29

def count; end

#pre_execObject



24
25
26
# File 'lib/haveapi/actions/default.rb', line 24

def pre_exec
  set_meta(total_count: count) if meta[:count]
end