Class: S3::ListAllMyBucketsParser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeListAllMyBucketsParser

Returns a new instance of ListAllMyBucketsParser.



608
609
610
# File 'lib/s3sync/S3.rb', line 608

def initialize
  reset
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



606
607
608
# File 'lib/s3sync/S3.rb', line 606

def entries
  @entries
end

Instance Method Details

#resetObject

get ready for another parse



639
640
641
642
643
644
# File 'lib/s3sync/S3.rb', line 639

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

#tag_end(name) ⇒ Object

we have one, add him to the entries list



619
620
621
622
623
624
625
626
627
628
# File 'lib/s3sync/S3.rb', line 619

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



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

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

#text(text) ⇒ Object



630
631
632
# File 'lib/s3sync/S3.rb', line 630

def text(text)
    @curr_text += text
end

#xmldecl(version, encoding, standalone) ⇒ Object



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

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