Module: Alula::DcpOperations::Request

Included in:
Alula::Dcp::Config::BusModules, Alula::Dcp::Config::BusModules::BusModule, Alula::Dcp::Config::CommData, Alula::Dcp::Config::CommData::AutoCommTestInterval, Alula::Dcp::Config::CommData::ServerHeartbeats, Alula::Dcp::Config::CommData::ServerKeepAlives, Alula::Dcp::Config::PanelOptions, Alula::Dcp::Config::PanelOptions::AcFailDetectDelay, Alula::Dcp::Config::PanelOptions::EventReportingDelay, Alula::Dcp::Config::PanelOptions::KeyFobButtonFunctions, Alula::Dcp::Config::PanelOptions::MinimumPinSize, Alula::Dcp::Config::PanelOptions::PanelLedBrightness, Alula::Dcp::Config::PanelOptions::PanelMiscOptions, Alula::Dcp::Config::PanelOptions::PanelOptions, Alula::Dcp::Config::PanelOptions::ReportableEventTypesPartitions, Alula::Dcp::Config::PanelOptions::ReportableEventTypesSystem, Alula::Dcp::Config::PanelOptions::SwingerThreshold, Alula::Dcp::Config::PanelOptions::SystemOptions, Alula::Dcp::Config::PanelOptions::TroubleBeepSuppress, Alula::Dcp::Config::PanelOptions::VirtualInterfaceOptions, Alula::Dcp::Config::Partitions, Alula::Dcp::Config::Partitions::Partition, Alula::Dcp::Config::SirenData, Alula::Dcp::Config::SirenData::Siren, Alula::Dcp::Config::Timers, Alula::Dcp::Config::Timers::EntryDelays, Alula::Dcp::Config::Timers::ExitDelays, Alula::Dcp::Config::Timers::SensorSupervisionTime, Alula::Dcp::Config::Timers::SirenTimeout, Alula::Dcp::Config::UsersData::DuressPin, Alula::Dcp::Config::UsersData::InstallerPin, Alula::Dcp::Config::UsersData::User
Defined in:
lib/alula/dcp_operations/request.rb

Overview

Allows for retrieving a single object by index

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



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

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

Instance Method Details

#retrieve(device_id, index, built_filters = {}) ⇒ Object

Load a single model by Index



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/alula/dcp_operations/request.rb', line 12

def retrieve(device_id, index, built_filters = {})
  response = Alula::Client.request(:get, resource_url(device_id, index), built_filters, {})
  if response.ok?
    item = new(device_id, index, response.data)
    item.rate_limit = response.rate_limit
    item
  else
    error_class = AlulaError.for_response(response)
    raise error_class
  end
end