Class: Aliyun::OSS::OSSObject::Metadata

Inherits:
Hash show all
Defined in:
lib/aliyun/oss/object.rb

Overview

:nodoc:

Constant Summary collapse

HEADER_PREFIX =
'x-oss-meta-'
SIZE_LIMIT =

2 kilobytes

2048

Instance Method Summary collapse

Methods inherited from Hash

#extractable_options?, #to_normalized_options, #to_normalized_options!, #to_query_string

Constructor Details

#initialize(headers) ⇒ Metadata

Returns a new instance of Metadata.



354
355
356
357
358
# File 'lib/aliyun/oss/object.rb', line 354

def initialize(headers)
  @headers = headers
  super()
  extract_metadata!
end

Instance Method Details

#[](header) ⇒ Object



364
365
366
# File 'lib/aliyun/oss/object.rb', line 364

def [](header)
  super(header_name(header.to_header))
end

#[]=(header, value) ⇒ Object



360
361
362
# File 'lib/aliyun/oss/object.rb', line 360

def []=(header, value)
  super(header_name(header.to_header), value)
end

#to_headersObject



368
369
370
371
# File 'lib/aliyun/oss/object.rb', line 368

def to_headers
  validate!
  self
end