Class: AWS::S3::Logging::Status::Builder

Inherits:
XmlGenerator show all
Defined in:
lib/aws/s3/logging.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from XmlGenerator

#xml

Instance Method Summary collapse

Methods inherited from String

#previous, #previous!, #remove_extended, #remove_extended!, #tap, #to_header, #underscore, #valid_utf8?

Constructor Details

#initialize(logging_status) ⇒ Builder

Returns a new instance of Builder.



69
70
71
72
# File 'lib/aws/s3/logging.rb', line 69

def initialize(logging_status)
  @logging_status = logging_status
  super()
end

Instance Attribute Details

#logging_statusObject (readonly)

Returns the value of attribute logging_status.



68
69
70
# File 'lib/aws/s3/logging.rb', line 68

def logging_status
  @logging_status
end

Instance Method Details

#buildObject



74
75
76
77
78
79
80
81
82
83
# File 'lib/aws/s3/logging.rb', line 74

def build
  xml.tag!('BucketLoggingStatus', 'xmlns' => 'http://s3.amazonaws.com/doc/2006-03-01/') do
    if logging_status.target_bucket && logging_status.target_prefix
      xml.LoggingEnabled do
        xml.TargetBucket logging_status.target_bucket
        xml.TargetPrefix logging_status.target_prefix
      end
    end
  end
end