Class: Zm::Client::AccountsCollection
- Inherits:
-
Base::AdminObjectsCollection
- Object
- Base::ObjectsCollection
- Base::AdminObjectsCollection
- Zm::Client::AccountsCollection
- Defined in:
- lib/zm/client/account/accounts_collection.rb
Overview
Collection Accounts
Direct Known Subclasses
Constant Summary
Constants inherited from Base::ObjectsCollection
Base::ObjectsCollection::METHODS_MISSING_LIST
Instance Attribute Summary
Attributes inherited from Base::ObjectsCollection
Instance Method Summary collapse
- #find_by(hash) ⇒ Object
-
#initialize(parent) ⇒ AccountsCollection
constructor
A new instance of AccountsCollection.
- #quotas ⇒ Object
Methods inherited from Base::AdminObjectsCollection
Methods inherited from Base::ObjectsCollection
#all, #all!, #build_from_entry, #find, #first, #logger, #method_missing, #new, #order, #page, #per_page, #respond_to_missing?
Constructor Details
#initialize(parent) ⇒ AccountsCollection
Returns a new instance of AccountsCollection.
7 8 9 10 11 12 |
# File 'lib/zm/client/account/accounts_collection.rb', line 7 def initialize(parent) @child_class = Account @builder_class = AccountsBuilder @search_type = SearchType::ACCOUNT super(parent) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Zm::Client::Base::ObjectsCollection
Instance Method Details
#find_by(hash) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/zm/client/account/accounts_collection.rb', line 14 def find_by(hash) rep = sac.get_account(hash.values.first, hash.keys.first, attrs_comma, @apply_cos) entry = rep[:Body][:GetAccountResponse][:account].first # puts entry reset_query_params build_from_entry(entry) end |
#quotas ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/zm/client/account/accounts_collection.rb', line 23 def quotas return nil if @domain_name.nil? && @target_server_id.nil? json = sac.get_quota_usage(@domain_name, @all_servers, @limit, @offset, @sort_by, @sort_ascending, @refresh, @target_server_id) reset_query_params @builder_class.new(@parent, json).make end |