Class: HaveAPI::Resources::ActionState::Index

Inherits:
Actions::Default::Index show all
Includes:
Mixin
Defined in:
lib/haveapi/resources/action_state.rb

Instance Attribute Summary

Attributes inherited from Action

#errors, #flags, #message, #version

Instance Method Summary collapse

Methods included from Mixin

#state_to_hash

Methods inherited from Actions::Default::Index

#count, #pre_exec

Methods included from Actions::Paginable

included

Methods inherited from Action

action_name, action_name=, authorize, #authorized?, build_route, #current_user, delayed_inherited, describe, example, from_context, inherit_attrs_from_resource, inherited, #initialize, initialize, input, #input, meta, #meta, model_adapter, output, #params, #pre_exec, #prepare, #request, 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

#execObject



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/haveapi/resources/action_state.rb', line 68

def exec
  ret = []
  actions = @context.server.action_state.list_pending(
      current_user,
      input[:offset],
      input[:limit],
      input[:order].to_sym
  )

  actions.each do |state|
    ret << state_to_hash(state)
  end

  ret
end