Class: Picasa::Presenter::Media

Inherits:
Base
  • Object
show all
Defined in:
lib/picasa/presenter/media.rb

Instance Attribute Summary

Attributes inherited from Base

#parsed_body

Instance Method Summary collapse

Methods inherited from Base

#initialize, #inspect

Methods included from Utils

array_wrap, inline_query, map_to_boolean, map_to_date, map_to_float, map_to_integer, retrieve, safe_retrieve

Constructor Details

This class inherits a constructor from Picasa::Presenter::Base

Instance Method Details

#cover_photo_urlString


12
13
14
15
16
# File 'lib/picasa/presenter/media.rb', line 12

def cover_photo_url
  return @cover_photo_url if defined?(@cover_photo_url)
  content = safe_retrieve(parsed_body, "media$content")
  @cover_photo_url = content && content[0]["url"]
end

#creditString


19
20
21
22
23
# File 'lib/picasa/presenter/media.rb', line 19

def credit
  return @credit if defined?(@credit)
  content = safe_retrieve(parsed_body, "media$credit")
  @credit = content && content[0]["$t"]
end

#descriptionString


26
27
28
# File 'lib/picasa/presenter/media.rb', line 26

def description
  @description ||= safe_retrieve(parsed_body, "media$description", "$t")
end

#keywordsString


31
32
33
# File 'lib/picasa/presenter/media.rb', line 31

def keywords
  @keywords ||= safe_retrieve(parsed_body, "media$keywords", "$t")
end

#thumbnailsArray<Presenter::Thumbnail>


7
8
9
# File 'lib/picasa/presenter/media.rb', line 7

def thumbnails
  @thumbnails ||= array_wrap(safe_retrieve(parsed_body, "media$thumbnail")).map { |thumbnail| Thumbnail.new(thumbnail) }
end

#titleString


36
37
38
# File 'lib/picasa/presenter/media.rb', line 36

def title
  @title ||= safe_retrieve(parsed_body, "media$title", "$t")
end