Sha256: c5588a5e57ca67e8d66fffd786f2bafccdd3f31bf36b3c2ca3a48666c8330dd4

Contents?: true

Size: 477 Bytes

Versions: 17

Compression:

Stored size: 477 Bytes

Contents

module CiviCrm
  module Actions
    module Find
      module ClassMethods
        def find(id)
          params = {'entity' => entity_class_name, 'action' => 'get', 'id' => id}
          response = CiviCrm::Client.request(:get, params)

          Resource.build_from(response, params).first or
            raise Error, "Couldn't find #{entity_class_name}##{id}"
        end
      end

      def self.included(base)
        base.extend(ClassMethods)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
civicrm-1.3.7 lib/civicrm/actions/find.rb
civicrm-1.3.6 lib/civicrm/actions/find.rb
civicrm-1.3.5 lib/civicrm/actions/find.rb
civicrm-1.3.4 lib/civicrm/actions/find.rb
civicrm-1.3.3 lib/civicrm/actions/find.rb
civicrm-1.3.2 lib/civicrm/actions/find.rb
civicrm-1.3.1 lib/civicrm/actions/find.rb
civicrm-1.2.5 lib/civicrm/actions/find.rb
civicrm-1.2.2 lib/civicrm/actions/find.rb
civicrm-1.2.1 lib/civicrm/actions/find.rb
civicrm-1.2.0 lib/civicrm/actions/find.rb
civicrm-1.1.1 lib/civicrm/actions/find.rb
civicrm-1.1.0 lib/civicrm/actions/find.rb
civicrm-1.0.7 lib/civicrm/actions/find.rb
civicrm-1.0.6 lib/civicrm/actions/find.rb
civicrm-1.0.5 lib/civicrm/actions/find.rb
civicrm-1.0.4 lib/civicrm/actions/find.rb