Class: S3::Concerns::ObjectsResult

Inherits:
Driver::Model
  • Object
show all
Defined in:
lib/s3/client/model/concerns/objects_result.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml_doc) ⇒ ObjectsResult

Returns a new instance of ObjectsResult.



4
5
6
# File 'lib/s3/client/model/concerns/objects_result.rb', line 4

def initialize(xml_doc)
  @xml_doc = xml_doc
end

Instance Method Details

#full_objectsObject



12
13
14
15
16
# File 'lib/s3/client/model/concerns/objects_result.rb', line 12

def full_objects
  REXML::XPath.match(@xml_doc, "/ListBucketResult/Contents").map{|m|
    XmlSimple.xml_in(m.to_s)
  }
end

#markerObject



22
23
24
# File 'lib/s3/client/model/concerns/objects_result.rb', line 22

def marker
  REXML::XPath.match(@xml_doc, "/ListBucketResult/Marker").map { |b| b.text }.first
end

#maxObject



30
31
32
# File 'lib/s3/client/model/concerns/objects_result.rb', line 30

def max
  REXML::XPath.match(@xml_doc, "/ListBucketResult/MaxKeys").map { |b| b.text }.first.to_i
end

#next_markerObject



26
27
28
# File 'lib/s3/client/model/concerns/objects_result.rb', line 26

def next_marker
  REXML::XPath.match(@xml_doc, "/ListBucketResult/NextMarker").map { |b| b.text }.first
end

#objectsObject



8
9
10
# File 'lib/s3/client/model/concerns/objects_result.rb', line 8

def objects
  REXML::XPath.match(@xml_doc, "/ListBucketResult/Contents/Key").map { |b| b.text }
end

#truncated?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/s3/client/model/concerns/objects_result.rb', line 18

def truncated?
  REXML::XPath.match(@xml_doc, "/ListBucketResult/IsTruncated").map { |b| b.text }.first == 'true'
end