Sha256: dc5534dca76c91456497637f5b699cf2f3efe1fc7394c659c1aa47ddc00c673d

Contents?: true

Size: 1.82 KB

Versions: 2

Compression:

Stored size: 1.82 KB

Contents

require "picasa/presenter/base"

module Picasa
  module Presenter
    class CommentList < Base
      # @return [Presenter::Author]
      def author
        @author ||= Author.new(safe_retrieve(parsed_body, "author"))
      end

      # @return [Array<Presenter::Comment>]
      def entries
        @entries ||= array_wrap(safe_retrieve(parsed_body, "entry")).map { |entry| Comment.new(entry) }
      end
      alias :comments :entries

      # @return [Array<Presenter::Link>]
      def links
        @links ||= array_wrap(safe_retrieve(parsed_body, "link")).map { |link| Link.new(link) }
      end

      # @return [String]
      def title
        @title ||= safe_retrieve(parsed_body, "title")
      end

      # @return [DateTime]
      def updated
        @updated ||= map_to_date(safe_retrieve(parsed_body, "updated"))
      end

      # @return [String]
      def icon
        @icon ||= safe_retrieve(parsed_body, "icon")
      end

      # @return [String]
      def generator
        @generator ||= safe_retrieve(parsed_body, "generator", "__content__")
      end

      # @return [Integer]
      def total_results
        @total_results ||= map_to_integer(safe_retrieve(parsed_body, "totalResults"))
      end

      # @return [Integer]
      def start_index
        @start_index ||= map_to_integer(safe_retrieve(parsed_body, "startIndex"))
      end

      # @return [Integer]
      def items_per_page
        @items_per_page ||= map_to_integer(safe_retrieve(parsed_body, "itemsPerPage"))
      end

      # @return [String]
      def user
        @user ||= safe_retrieve(parsed_body, "user")
      end

      # @return [String]
      def nickname
        @nickname ||= safe_retrieve(parsed_body, "nickname")
      end

      # @return [String]
      def thumbnail
        @thumbnail ||= safe_retrieve(parsed_body, "thumbnail")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
picasa-0.5.4 lib/picasa/presenter/comment_list.rb
picasa-0.5.3 lib/picasa/presenter/comment_list.rb