Class: Zm::Client::ResourcesCollection

Inherits:
Base::AdminObjectsCollection show all
Defined in:
lib/zm/client/resource/resources_collection.rb

Overview

Collection Resources

Constant Summary

Constants inherited from Base::ObjectsCollection

Base::ObjectsCollection::METHODS_MISSING_LIST

Instance Attribute Summary

Attributes inherited from Base::ObjectsCollection

#parent

Instance Method Summary collapse

Methods inherited from Base::AdminObjectsCollection

#attrs, #count, #ldap, #where

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) ⇒ ResourcesCollection

Returns a new instance of ResourcesCollection.



7
8
9
10
11
12
# File 'lib/zm/client/resource/resources_collection.rb', line 7

def initialize(parent)
  @child_class = Resource
  @builder_class = ResourcesBuilder
  @search_type = SearchType::RESOURCE
  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
# File 'lib/zm/client/resource/resources_collection.rb', line 14

def find_by(hash)
  rep = sac.get_resource(hash.values.first, hash.keys.first, attrs_comma)
  entry = rep[:Body][:GetCalendarResourceResponse][:calresource].first

  reset_query_params
  build_from_entry(entry)
end