Class: S3::ListAllMyBucketsParser

Inherits:
Object
  • Object
show all
Defined in:
lib/s3-ruby.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeListAllMyBucketsParser

Returns a new instance of ListAllMyBucketsParser.



562
563
564
# File 'lib/s3-ruby.rb', line 562

def initialize
  reset
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



560
561
562
# File 'lib/s3-ruby.rb', line 560

def entries
  @entries
end

Instance Method Details

#resetObject

get ready for another parse



593
594
595
596
597
598
# File 'lib/s3-ruby.rb', line 593

def reset
  @entries = []
  @owner = nil
  @curr_bucket = nil
  @curr_text = ''
end

#tag_end(name) ⇒ Object

we have one, add him to the entries list



573
574
575
576
577
578
579
580
581
582
# File 'lib/s3-ruby.rb', line 573

def tag_end(name)
  if name == 'Bucket'
    @entries << @curr_bucket
  elsif name == 'Name'
    @curr_bucket.name = @curr_text
  elsif name == 'CreationDate'
    @curr_bucket.creation_date = @curr_text
  end
  @curr_text = ''
end

#tag_start(name, attributes) ⇒ Object



566
567
568
569
570
# File 'lib/s3-ruby.rb', line 566

def tag_start(name, attributes)
  if name == 'Bucket'
    @curr_bucket = Bucket.new
  end
end

#text(text) ⇒ Object



584
585
586
# File 'lib/s3-ruby.rb', line 584

def text(text)
    @curr_text += text
end

#xmldecl(version, encoding, standalone) ⇒ Object



588
589
590
# File 'lib/s3-ruby.rb', line 588

def xmldecl(version, encoding, standalone)
  # ignore
end