Class: Fog::Oracle::Collection
- Inherits:
-
Collection
- Object
- Collection
- Fog::Oracle::Collection
- Defined in:
- lib/fog/oracle/models/collection.rb
Direct Known Subclasses
Compute::Oracle::AccessGroups, Compute::Oracle::AccessHosts, Compute::Oracle::AffinityGroups, Compute::Oracle::ArchiveManagementAttributeses, Compute::Oracle::Assemblies, Compute::Oracle::AssemblyVirtualDisks, Compute::Oracle::AssemblyVms, Compute::Oracle::BackupManagementAttributeses, Compute::Oracle::BusinessSelections, Compute::Oracle::ClusterHeartbeatDevices, Compute::Oracle::ClusterStorageFses, Compute::Oracle::Clusters, Compute::Oracle::ComparisonTypes, Compute::Oracle::ControlDomains, Compute::Oracle::CpuCompatibilityGroups, Compute::Oracle::Cpus, Compute::Oracle::EthernetPorts, Compute::Oracle::EventManagementAttributeses, Compute::Oracle::EventQueries, Compute::Oracle::Events, Compute::Oracle::FileServerPlugins, Compute::Oracle::FileServers, Compute::Oracle::FileSystemMounts, Compute::Oracle::FileSystems, Compute::Oracle::Hypervisors, Compute::Oracle::IPAddresses, Compute::Oracle::JobErrors, Compute::Oracle::JobManagementAttributeses, Compute::Oracle::Jobs, Compute::Oracle::KeyValuePairs, Compute::Oracle::LoggerManagementAttributeses, Compute::Oracle::LoginCertificates, Compute::Oracle::MacManagementAttributeses, Compute::Oracle::Managers, Compute::Oracle::Networks, Compute::Oracle::PasswordChanges, Compute::Oracle::PeriodicTasks, Compute::Oracle::QosValues, Compute::Oracle::Repositories, Compute::Oracle::RepositoryExports, Compute::Oracle::RepositoryImports, Compute::Oracle::ResourceGroups, Compute::Oracle::ServerAbilitieses, Compute::Oracle::ServerControllers, Compute::Oracle::ServerEventAttributeses, Compute::Oracle::ServerPoolNetworkPolicies, Compute::Oracle::ServerPoolPolicies, Compute::Oracle::ServerPools, Compute::Oracle::ServerUpdateConfigurations, Compute::Oracle::ServerUpdateRepositoryConfigurations, Compute::Oracle::Servers, Compute::Oracle::SessionPropertieses, Compute::Oracle::StatisticQueries, Compute::Oracle::Statistics, Compute::Oracle::StatisticsManagementAttributeses, Compute::Oracle::StorageAbilityRecords, Compute::Oracle::StorageArrayPlugins, Compute::Oracle::StorageArrays, Compute::Oracle::StorageElements, Compute::Oracle::StorageInitiators, Compute::Oracle::StoragePaths, Compute::Oracle::StorageTargets, Compute::Oracle::StringLists, Compute::Oracle::UnselectedObjectDetailses, Compute::Oracle::VirtualDisks, Compute::Oracle::VirtualNics, Compute::Oracle::VirtualSwitches, Compute::Oracle::VlanInterfaces, Compute::Oracle::VmCloneDefinitions, Compute::Oracle::VmCloneNetworkMappings, Compute::Oracle::VmCloneStorageMappings, Compute::Oracle::VmDiskMappings, Compute::Oracle::Vms, Compute::Oracle::VolumeGroups, Compute::Oracle::WsErrorDetailses, Compute::Oracle::WsExceptions, Compute::Oracle::Zones
Instance Attribute Summary collapse
-
#response ⇒ Object
It’s important to store the whole response, it contains e.g.
Instance Method Summary collapse
-
#all(options = {}) ⇒ Object
Returns detailed list of records.
-
#get(id) ⇒ Object
(also: #find_by_id)
Gets record given record’s id.
- #id_value(id) ⇒ Object
- #load_response(response) ⇒ Object
- #new_from_response(response) ⇒ Object
Instance Attribute Details
#response ⇒ Object
It’s important to store the whole response, it contains e.g. important info about whether there is another page of data.
8 9 10 |
# File 'lib/fog/oracle/models/collection.rb', line 8 def response @response end |
Instance Method Details
#all(options = {}) ⇒ Object
Returns detailed list of records
36 37 38 |
# File 'lib/fog/oracle/models/collection.rb', line 36 def all( = {}) raise Fog::Oracle::Errors::InterfaceNotImplemented.new('Method :all is not implemented') end |
#get(id) ⇒ Object Also known as: find_by_id
Gets record given record’s id
41 42 43 |
# File 'lib/fog/oracle/models/collection.rb', line 41 def get(id) raise Fog::Oracle::Errors::InterfaceNotImplemented.new('Method :get is not implemented') end |
#id_value(id) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/fog/oracle/models/collection.rb', line 10 def id_value(id) if id.is_a?(Hash) id["value"] else id end end |
#load_response(response) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/fog/oracle/models/collection.rb', line 18 def load_response(response) objects = response.body clear && objects.each { |object| self << new(object) } self.response = response self end |
#new_from_response(response) ⇒ Object
26 27 28 29 30 |
# File 'lib/fog/oracle/models/collection.rb', line 26 def new_from_response(response) obj = new(response.body) obj.response = response obj end |