Class: Besepa::Group
- Includes:
- ApiCalls::Create, ApiCalls::Destroy, ApiCalls::List, ApiCalls::Update
- Defined in:
- lib/besepa/group.rb
Constant Summary collapse
- FIELDS =
[:id, :name, :reference, :created_at, :memberships_count]
Constants inherited from Resource
Constants included from Utils::Request
Utils::Request::END_POINT_URL_PREFIX
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
Methods included from ApiCalls::Destroy
Methods included from ApiCalls::Update
Methods included from ApiCalls::Create
Methods included from ApiCalls::List
Methods inherited from Resource
#allowed_nils, #as_json, handle_errors, #initialize, klass_name, #klass_name, #serializable_hash, #to_hash
Methods included from Utils::Request
Methods included from Utils::Connection
Constructor Details
This class inherits a constructor from Besepa::Resource
Instance Method Details
#api_path(filters = {}) ⇒ Object
24 25 26 |
# File 'lib/besepa/group.rb', line 24 def api_path(filters = {}) "#{self.class.api_path(filters)}/#{CGI.escape(id)}" end |
#customers ⇒ Object
15 16 17 |
# File 'lib/besepa/group.rb', line 15 def customers Customer.search({ field: :group_id, value: id}) end |
#stats ⇒ Object
19 20 21 22 |
# File 'lib/besepa/group.rb', line 19 def stats response = get "#{api_path}/stats" response['response'] end |