Class: Zm::Client::DomainsCollection
- Inherits:
-
Base::AdminObjectsCollection
- Object
- Base::ObjectsCollection
- Base::AdminObjectsCollection
- Zm::Client::DomainsCollection
- Defined in:
- lib/zm/client/domain/domains_collection.rb
Overview
Class Collection [Domain]
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
- #build_find_by(hash) ⇒ Object
- #find_by!(hash) ⇒ Object
-
#initialize(parent) ⇒ DomainsCollection
constructor
A new instance of DomainsCollection.
Methods inherited from Base::AdminObjectsCollection
#attrs, #build_query, #clear, #count, #find_by, #find_by_or_nil, #find_each, #ldap, #make_query, #where
Methods inherited from Base::ObjectsCollection
#all, #find, #first, #logger, #method_missing, #new, #order, #page, #per_page, #respond_to_missing?
Methods included from Inspector
#inspect, #instance_variables_map, #to_h, #to_s
Constructor Details
#initialize(parent) ⇒ DomainsCollection
Returns a new instance of DomainsCollection.
7 8 9 10 11 12 |
# File 'lib/zm/client/domain/domains_collection.rb', line 7 def initialize(parent) @child_class = Domain @builder_class = DomainsBuilder @search_type = SearchType::DOMAIN super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Zm::Client::Base::ObjectsCollection
Instance Method Details
#build_find_by(hash) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/zm/client/domain/domains_collection.rb', line 21 def build_find_by(hash) soap_request = SoapElement.admin(SoapAdminConstants::GET_DOMAIN_REQUEST) node_domain = SoapElement.create(SoapConstants::DOMAIN) .add_attribute(SoapConstants::BY, hash.keys.first) .add_content(hash.values.first) soap_request.add_node(node_domain) soap_request.add_attribute(SoapConstants::ATTRS, attrs_comma) soap_request end |
#find_by!(hash) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/zm/client/domain/domains_collection.rb', line 14 def find_by!(hash) entry = sac.invoke(build_find_by(hash))[:GetDomainResponse][:domain].first reset_query_params DomainJsnsInitializer.create(@parent, entry) end |