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

Inherits:
Object
  • Object
show all
Includes:
SelectiveAttributeProxy
Defined in:
lib/aliyun/oss/logging.rb

Overview

Logging status captures information about the calling bucket’s logging settings. If logging is enabled for the bucket the status object will indicate what bucket the logs are written to via the target_bucket method as well as the logging key prefix with via target_prefix.

See the documentation for Logging::Management::ClassMethods for more information on how to get the logging status of a bucket.

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SelectiveAttributeProxy

included

Constructor Details

#initialize(attributes = {}) ⇒ Status

:nodoc:



55
56
57
58
59
# File 'lib/aliyun/oss/logging.rb', line 55

def initialize(attributes = {}) #:nodoc:
  attributes  = {'target_bucket' => nil, 'target_prefix' => nil}.merge(attributes)
  @enabled    = attributes.has_key?('logging_enabled')
  @attributes = attributes.delete('logging_enabled') || attributes
end

Instance Attribute Details

#enabledObject (readonly) Also known as: logging_enabled?

Returns the value of attribute enabled.



52
53
54
# File 'lib/aliyun/oss/logging.rb', line 52

def enabled
  @enabled
end

Instance Method Details

#to_xmlObject

:nodoc:



61
62
63
# File 'lib/aliyun/oss/logging.rb', line 61

def to_xml #:nodoc:
  Builder.new(self).to_s
end