require "picasa/presenter/base" module Picasa module Presenter class Album < Base # @return [Presenter::Author] def author @author ||= Author.new(safe_retrieve(parsed_body, "author")) end # @return [Array] def entries @entries ||= array_wrap(safe_retrieve(parsed_body, "entry")).map { |photo| Photo.new(photo) } end alias :photos :entries # @return [Array] def links @links ||= safe_retrieve(parsed_body, "link").map { |link| Link.new(link) } end # @return [Presenter::Media] def media @media ||= Media.new(safe_retrieve(parsed_body, "group")) end # @return [DateTime] def published @published ||= map_to_date(safe_retrieve(parsed_body, "published")) end # @return [DateTime] def updated @updated ||= map_to_date(safe_retrieve(parsed_body, "updated")) end # @return [String] def title @title ||= safe_retrieve(parsed_body, "title") end # @return [String] def summary @summary ||= safe_retrieve(parsed_body, "summary") end # @return [String] def rights @rights ||= safe_retrieve(parsed_body, "rights") end # @return [String] def id @id ||= array_wrap(safe_retrieve(parsed_body, "id"))[1] end # @return [String] def name @name ||= safe_retrieve(parsed_body, "name") end # @return [String] def location @location ||= safe_retrieve(parsed_body, "location") end # @return [String] def access @access ||= safe_retrieve(parsed_body, "access") end # @return [String] def timestamp @timestamp ||= safe_retrieve(parsed_body, "timestamp") end # @return [String] def numphotos @numphotos ||= map_to_integer(safe_retrieve(parsed_body, "numphotos")) end # @return [String] def user @user ||= safe_retrieve(parsed_body, "user") end # @return [String] def nickname @nickname ||= safe_retrieve(parsed_body, "nickname") end end end end