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.



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

def initialize
  reset
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



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

def entries
  @entries
end

Instance Method Details

#resetObject

get ready for another parse



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

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

#tag_end(name) ⇒ Object

we have one, add him to the entries list



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

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



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

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

#text(text) ⇒ Object



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

def text(text)
  @curr_text += text
end

#xmldecl(version, encoding, standalone) ⇒ Object



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

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