Class: S3::LocationParser

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLocationParser

Returns a new instance of LocationParser.



744
745
746
747
# File 'lib/S3.rb', line 744

def initialize
  @state = :init
  @location = nil
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



736
737
738
# File 'lib/S3.rb', line 736

def location
  @location
end

Class Method Details

.parse(msg) ⇒ Object



738
739
740
741
742
# File 'lib/S3.rb', line 738

def self.parse(msg)
    parser = LocationParser.new
    REXML::Document.parse_stream(msg, parser)
    return parser.location
end

Instance Method Details

#tag_end(name) ⇒ Object

we have one, add him to the entries list



761
762
763
764
765
766
# File 'lib/S3.rb', line 761

def tag_end(name)
  case @state
  when :tag_locationconstraint
    @state = :done
  end
end

#tag_start(name, attributes) ⇒ Object



749
750
751
752
753
754
755
756
757
758
# File 'lib/S3.rb', line 749

def tag_start(name, attributes)
  if @state == :init
    if name == 'LocationConstraint'
      @state = :tag_locationconstraint
      @location = ''
    else
      @state = :bad
    end
  end
end

#text(text) ⇒ Object



768
769
770
# File 'lib/S3.rb', line 768

def text(text)
  @location += text if @state == :tag_locationconstraint
end

#xmldecl(version, encoding, standalone) ⇒ Object



772
773
774
# File 'lib/S3.rb', line 772

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