Class: PrettyAws::RdsSnapshot
- Inherits:
-
Object
- Object
- PrettyAws::RdsSnapshot
- Defined in:
- lib/pretty_aws/rds_snapshot.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Class Method Summary collapse
Instance Method Summary collapse
- #created_at ⇒ Object
- #db_id ⇒ Object
- #id ⇒ Object
-
#initialize(params) ⇒ RdsSnapshot
constructor
A new instance of RdsSnapshot.
- #status ⇒ Object
- #storage ⇒ Object
Constructor Details
#initialize(params) ⇒ RdsSnapshot
Returns a new instance of RdsSnapshot.
26 27 28 |
# File 'lib/pretty_aws/rds_snapshot.rb', line 26 def initialize(params) @params=params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/pretty_aws/rds_snapshot.rb', line 4 def params @params end |
Class Method Details
.all ⇒ Object
10 11 12 |
# File 'lib/pretty_aws/rds_snapshot.rb', line 10 def self.all Base.rds.describe_db_snapshots.collect { |params| new(params) } end |
.find_all_and_group ⇒ Object
6 7 8 |
# File 'lib/pretty_aws/rds_snapshot.rb', line 6 def self.find_all_and_group group_by_db(all) end |
.group_by_db(items) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/pretty_aws/rds_snapshot.rb', line 14 def self.group_by_db(items) if items.nil? return {} end grouped = { } items.each do |item| grouped[item.db_id] ||= [ ] grouped[item.db_id] << item end grouped end |
Instance Method Details
#created_at ⇒ Object
42 43 44 |
# File 'lib/pretty_aws/rds_snapshot.rb', line 42 def created_at @params[:instance_create_time] end |
#db_id ⇒ Object
38 39 40 |
# File 'lib/pretty_aws/rds_snapshot.rb', line 38 def db_id @params[:db_instance_identifier] end |
#id ⇒ Object
30 31 32 |
# File 'lib/pretty_aws/rds_snapshot.rb', line 30 def id @params[:db_snapshot_identifier] end |
#status ⇒ Object
46 47 48 |
# File 'lib/pretty_aws/rds_snapshot.rb', line 46 def status @params[:status] end |
#storage ⇒ Object
34 35 36 |
# File 'lib/pretty_aws/rds_snapshot.rb', line 34 def storage @params[:allocated_storage] end |