Class: Zm::Client::MountPointsCollection

Inherits:
Base::ObjectsCollection show all
Defined in:
lib/zm/client/mountpoint/mountpoints_collection.rb

Overview

collection of mountpoints

Constant Summary collapse

METHODS_MISSING_LIST =
i[select each map length].to_set.freeze

Instance Attribute Summary collapse

Attributes inherited from Base::ObjectsCollection

#parent

Instance Method Summary collapse

Methods inherited from Base::ObjectsCollection

#attrs, #build_from_entry, #count, #find, #first, #method_missing, #order, #page, #per_page, #respond_to_missing?

Constructor Details

#initialize(parent) ⇒ MountPointsCollection

Returns a new instance of MountPointsCollection.



11
12
13
14
15
# File 'lib/zm/client/mountpoint/mountpoints_collection.rb', line 11

def initialize(parent)
  @parent = parent
  @root = nil
  reset_query_params
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Zm::Client::Base::ObjectsCollection

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



9
10
11
# File 'lib/zm/client/mountpoint/mountpoints_collection.rb', line 9

def root
  @root
end

Instance Method Details

#allObject



30
31
32
# File 'lib/zm/client/mountpoint/mountpoints_collection.rb', line 30

def all
  @all || all!
end

#all!Object



34
35
36
# File 'lib/zm/client/mountpoint/mountpoints_collection.rb', line 34

def all!
  build_response
end

#clearObject



38
39
40
41
42
# File 'lib/zm/client/mountpoint/mountpoints_collection.rb', line 38

def clear
  @all = nil
  @root = nil
  reset_query_params
end

#new {|mountpoint| ... } ⇒ Object

Yields:

  • (mountpoint)


17
18
19
20
21
# File 'lib/zm/client/mountpoint/mountpoints_collection.rb', line 17

def new
  mountpoint = MountPoint.new(@parent)
  yield(mountpoint) if block_given?
  mountpoint
end

#where(view: nil, tr: nil) ⇒ Object



23
24
25
26
27
28
# File 'lib/zm/client/mountpoint/mountpoints_collection.rb', line 23

def where(view: nil, tr: nil)
  @view = view
  @tr = tr
  @all = nil
  self
end