Module: CiviCrm::Actions::List::ClassMethods

Defined in:
lib/civicrm/actions/list.rb

Instance Method Summary collapse

Instance Method Details

#all(params = {}) ⇒ Object



5
6
7
8
9
# File 'lib/civicrm/actions/list.rb', line 5

def all(params = {})
  params.merge!('entity' => entity_class_name, 'action' => 'get')
  response = CiviCrm::Client.request(:get, params)
  Resource.build_from(response, params)
end

#countObject



11
12
13
# File 'lib/civicrm/actions/list.rb', line 11

def count
  all.count
end

#find_by(params = {}) ⇒ Object



15
16
17
# File 'lib/civicrm/actions/list.rb', line 15

def find_by(params={})
  all(params).first
end

#find_by!(params = {}) ⇒ Object



19
20
21
# File 'lib/civicrm/actions/list.rb', line 19

def find_by!(params={})
  find_by(params) or raise Errors::NotFound.new
end

#firstObject



23
24
25
# File 'lib/civicrm/actions/list.rb', line 23

def first
  all.first
end

#lastObject



27
28
29
# File 'lib/civicrm/actions/list.rb', line 27

def last
  all.last
end