Module: Alula::DcpOperations::List

Included in:
Alula::Dcp::UsersData
Defined in:
lib/alula/dcp_operations/list.rb

Overview

Allows for the creation of a list of objects

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



11
12
13
# File 'lib/alula/dcp_operations/list.rb', line 11

def method_missing(method, *args, &block)
  QueryInterface.new(self).send(method, *args, &block)
end

Class Method Details

.extended(base) ⇒ Object



7
8
9
# File 'lib/alula/dcp_operations/list.rb', line 7

def self.extended(base)
  base.include(InstanceMethods)
end

Instance Method Details

#list(device_id, filters = {}, opts = {}) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/alula/dcp_operations/list.rb', line 19

def list(device_id, filters = {}, opts = {})
  response = Alula::Client.request(:get, resource_url(device_id), filters, opts)
  if response.ok?
    Alula::Dcp::ListObject.construct_from_response(device_id, self, response, opts)
  else
    error_class = AlulaError.for_response(response)
    raise error_class
  end
end

#respond_to_missing?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/alula/dcp_operations/list.rb', line 15

def respond_to_missing?(method, include_private = false)
  QueryInterface.new(self).respond_to?(method, include_private)
end