Module: AwsExtensions::S3::BucketWebsite
- Defined in:
- lib/aws_extensions/s3/BucketWebsite.rb
Instance Method Summary collapse
-
#safe_error ⇒ Object
Public: Get the error_document if it is present, or nil if it is not.
-
#safe_index ⇒ Object
Public: Get the index_document if it is present, or nil if it is not.
-
#safe_redirection ⇒ Object
Public: Get the redirection if it is present, or nil if it is not.
-
#to_cumulus ⇒ Object
Public: Convert this Aws::S3::BucketWebsite into a Cumulus::S3:WebsiteConfig.
Instance Method Details
#safe_error ⇒ Object
Public: Get the error_document if it is present, or nil if it is not
Returns the value
29 30 31 32 33 |
# File 'lib/aws_extensions/s3/BucketWebsite.rb', line 29 def safe_error error_document.key rescue Aws::S3::Errors::NoSuchWebsiteConfiguration, NoMethodError nil end |
#safe_index ⇒ Object
Public: Get the index_document if it is present, or nil if it is not
Returns the value
20 21 22 23 24 |
# File 'lib/aws_extensions/s3/BucketWebsite.rb', line 20 def safe_index index_document.suffix rescue Aws::S3::Errors::NoSuchWebsiteConfiguration, NoMethodError nil end |
#safe_redirection ⇒ Object
Public: Get the redirection if it is present, or nil if it is not
Returns the value
38 39 40 41 42 43 44 45 46 |
# File 'lib/aws_extensions/s3/BucketWebsite.rb', line 38 def safe_redirection if redirect_all_requests_to.protocol "#{redirect_all_requests_to.protocol}://#{redirect_all_requests_to.host_name}" else redirect_all_requests_to.host_name end rescue Aws::S3::Errors::NoSuchWebsiteConfiguration, NoMethodError nil end |
#to_cumulus ⇒ Object
Public: Convert this Aws::S3::BucketWebsite into a Cumulus::S3:WebsiteConfig
Returns a WebsiteConfig
9 10 11 12 13 14 15 |
# File 'lib/aws_extensions/s3/BucketWebsite.rb', line 9 def to_cumulus if safe_index or safe_redirection cumulus = Cumulus::S3::WebsiteConfig.new cumulus.populate!(self) cumulus end end |