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
31 32 33 34 35 |
# File 'lib/aws_extensions/s3/BucketWebsite.rb', line 31 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
22 23 24 25 26 |
# File 'lib/aws_extensions/s3/BucketWebsite.rb', line 22 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
40 41 42 43 44 45 46 47 48 |
# File 'lib/aws_extensions/s3/BucketWebsite.rb', line 40 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
11 12 13 14 15 16 17 |
# File 'lib/aws_extensions/s3/BucketWebsite.rb', line 11 def to_cumulus if safe_index or safe_redirection cumulus = Cumulus::S3::WebsiteConfig.new cumulus.populate!(self) cumulus end end |