Class: UltraVault::DiskSafe
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- UltraVault::DiskSafe
- Defined in:
- lib/ultravault/data_objects/disk_safe.rb
Defined Under Namespace
Classes: DeviceList
Instance Attribute Summary collapse
-
#agent_id ⇒ Object
readonly
Returns the value of attribute agent_id.
-
#compression_level ⇒ Object
readonly
Returns the value of attribute compression_level.
-
#compression_type ⇒ Object
readonly
Returns the value of attribute compression_type.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#device_count ⇒ Object
readonly
Returns the value of attribute device_count.
-
#device_list ⇒ Object
readonly
Returns the value of attribute device_list.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#open ⇒ Object
readonly
Returns the value of attribute open.
-
#recovery_point_count ⇒ Object
readonly
Returns the value of attribute recovery_point_count.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#size_of_deltas ⇒ Object
readonly
Returns the value of attribute size_of_deltas.
-
#volume_id ⇒ Object
readonly
Returns the value of attribute volume_id.
Class Method Summary collapse
-
.all ⇒ [UltraVault::DiskSafe]
Returns all disk safes for the current user.
-
.find_all_by_agent_id(agent_id) ⇒ [UltraVault::DiskSafe]
Returns an array of disk safes, if found.
Instance Method Summary collapse
-
#initialize(params) ⇒ DiskSafe
constructor
A new instance of DiskSafe.
- #policies ⇒ Object
- #recovery_points ⇒ Object
Constructor Details
#initialize(params) ⇒ DiskSafe
Returns a new instance of DiskSafe.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 8 def initialize(params) @agent_id = params[:agent_id] @compression_level = params[:compression_level] @compression_type = params[:compression_type] @description = params[:description] @device_count = params[:device_count].to_i @device_list = [params[:device_list]].flatten.collect do |device| DeviceList.new(device) if device end @id = params[:id] @open = params[:open] @recovery_point_count = params[:recovery_point_count].to_i @size = params[:size].to_i @size_of_deltas = params[:size_of_deltas_in_disk_safe].to_i @volume_id = params[:volume_id] extract_attributes params[:disk_safe_attribute_map] super(params) end |
Instance Attribute Details
#agent_id ⇒ Object (readonly)
Returns the value of attribute agent_id.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def agent_id @agent_id end |
#compression_level ⇒ Object (readonly)
Returns the value of attribute compression_level.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def compression_level @compression_level end |
#compression_type ⇒ Object (readonly)
Returns the value of attribute compression_type.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def compression_type @compression_type end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def description @description end |
#device_count ⇒ Object (readonly)
Returns the value of attribute device_count.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def device_count @device_count end |
#device_list ⇒ Object (readonly)
Returns the value of attribute device_list.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def device_list @device_list end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def id @id end |
#open ⇒ Object (readonly)
Returns the value of attribute open.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def open @open end |
#recovery_point_count ⇒ Object (readonly)
Returns the value of attribute recovery_point_count.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def recovery_point_count @recovery_point_count end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def size @size end |
#size_of_deltas ⇒ Object (readonly)
Returns the value of attribute size_of_deltas.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def size_of_deltas @size_of_deltas end |
#volume_id ⇒ Object (readonly)
Returns the value of attribute volume_id.
3 4 5 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 3 def volume_id @volume_id end |
Class Method Details
.all ⇒ [UltraVault::DiskSafe]
Returns all disk safes for the current user.
48 49 50 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 48 def self.all UltraVault::DiskSafeService.new.all_disk_safes end |
.find_all_by_agent_id(agent_id) ⇒ [UltraVault::DiskSafe]
Returns an array of disk safes, if found.
40 41 42 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 40 def self.find_all_by_agent_id(agent_id) UltraVault::DiskSafeService.new.find_disksafes_by_agent_id agent_id end |
Instance Method Details
#policies ⇒ Object
31 32 33 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 31 def policies @policies ||= UltraVault::Policy.all.map { |policy| policy if policy.disk_safe_id == id }.compact end |
#recovery_points ⇒ Object
27 28 29 |
# File 'lib/ultravault/data_objects/disk_safe.rb', line 27 def recovery_points @recovery_points ||= UltraVault::RecoveryPointService.new.find_recovery_points_by_disk_safe_id(id) end |