Class: S3::Concerns::ObjectsResult
- Inherits:
-
Driver::Model
- Object
- Driver::Model
- S3::Concerns::ObjectsResult
- Defined in:
- lib/s3/client/model/concerns/objects_result.rb
Instance Method Summary collapse
- #full_objects ⇒ Object
-
#initialize(xml_doc) ⇒ ObjectsResult
constructor
A new instance of ObjectsResult.
- #marker ⇒ Object
- #max ⇒ Object
- #next_marker ⇒ Object
- #objects ⇒ Object
- #truncated? ⇒ Boolean
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_objects ⇒ Object
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 |
#marker ⇒ Object
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 |
#max ⇒ Object
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_marker ⇒ Object
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 |
#objects ⇒ Object
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
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 |