Class: S3::ListAllMyBucketsParser

Inherits:
Object
  • Object
show all
Defined in:
lib/S3.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeListAllMyBucketsParser

Returns a new instance of ListAllMyBucketsParser.



612
613
614
# File 'lib/S3.rb', line 612

def initialize
  reset
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



610
611
612
# File 'lib/S3.rb', line 610

def entries
  @entries
end

Instance Method Details

#resetObject

get ready for another parse



643
644
645
646
647
648
# File 'lib/S3.rb', line 643

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

#tag_end(name) ⇒ Object

we have one, add him to the entries list



623
624
625
626
627
628
629
630
631
632
# File 'lib/S3.rb', line 623

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



616
617
618
619
620
# File 'lib/S3.rb', line 616

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

#text(text) ⇒ Object



634
635
636
# File 'lib/S3.rb', line 634

def text(text)
    @curr_text += text
end

#xmldecl(version, encoding, standalone) ⇒ Object



638
639
640
# File 'lib/S3.rb', line 638

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