Class: Aliyun::OSS::Logging::Status::Builder

Inherits:
XmlGenerator show all
Defined in:
lib/aliyun/oss/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.



70
71
72
73
# File 'lib/aliyun/oss/logging.rb', line 70

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

Instance Attribute Details

#logging_statusObject (readonly)

Returns the value of attribute logging_status.



69
70
71
# File 'lib/aliyun/oss/logging.rb', line 69

def logging_status
  @logging_status
end

Instance Method Details

#buildObject



75
76
77
78
79
80
81
82
83
84
# File 'lib/aliyun/oss/logging.rb', line 75

def build
  xml.tag!('BucketLoggingStatus', 'xmlns' => 'http://oss.aliyuncs.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