Class: S3Secure::Summary::Items
- Extended by:
- Memoist
- Defined in:
- lib/s3_secure/summary/items.rb
Instance Method Summary collapse
-
#all_items ⇒ Object
Triggers loading of items.
- #filtered_items ⇒ Object
-
#initialize(options, buckets) ⇒ Items
constructor
override initialize.
- #load_items! ⇒ Object
Methods inherited from CLI::Base
Methods included from CLI::Say
Methods included from AwsServices
Methods included from AwsServices::S3
#check_bucket!, #new_s3_regional_client, #region, #region_map, #s3, #s3_client, #s3_regional_client
Constructor Details
#initialize(options, buckets) ⇒ Items
override initialize
6 7 8 9 |
# File 'lib/s3_secure/summary/items.rb', line 6 def initialize(, buckets) , @buckets = , buckets @ssl, @encrypted = [:ssl], [:encrypted] end |
Instance Method Details
#all_items ⇒ Object
Triggers loading of items
32 33 34 |
# File 'lib/s3_secure/summary/items.rb', line 32 def all_items load_items! end |
#filtered_items ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/s3_secure/summary/items.rb', line 11 def filtered_items items = all_items.select do |item| case @ssl when "yes", "no" @ssl == item.ssl else # any or fallback true end end items.select do |item| case @encrypted when "yes", "no" @encrypted == item.encrypted else # any or fallback true end end end |
#load_items! ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/s3_secure/summary/items.rb', line 36 def load_items! @buckets.map do |bucket| Item.new(bucket, ssl: ssl?(bucket) ? "yes" : "no", encrypted: encrypted?(bucket) ? "yes" : "no") end end |