Class | Amazon::Ecs::Response |
In: |
lib/amazon/ecs.rb
|
Parent: | Object |
XML input is in string format
# File lib/amazon/ecs.rb, line 124 def initialize(xml) @doc = Hpricot(xml) end
Return the first item (Amazon::Element)
# File lib/amazon/ecs.rb, line 162 def first_item items.first end
Return true if request is valid.
# File lib/amazon/ecs.rb, line 134 def is_valid_request? (@doc/"isvalid").inner_html == "True" end
Return an array of Amazon::Element item objects.
# File lib/amazon/ecs.rb, line 154 def items unless @items @items = (@doc/"item").collect {|item| Element.new(item)} end @items end
Return total pages.
# File lib/amazon/ecs.rb, line 183 def total_pages unless @total_pages @total_pages = (@doc/"totalpages").inner_html.to_i end @total_pages end