Class: Picasa::Presenter::Album

Inherits:
Base
  • Object
show all
Defined in:
lib/picasa/presenter/album.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

#accessString


84
85
86
# File 'lib/picasa/presenter/album.rb', line 84

def access
  @access ||= safe_retrieve(parsed_body, "gphoto$access")
end

#allow_downloadstrue, ...


114
115
116
# File 'lib/picasa/presenter/album.rb', line 114

def allow_downloads
  @allow_downloads ||= map_to_boolean(safe_retrieve(parsed_body, "gphoto$allowDownloads"))
end

#allow_printstrue, ...


109
110
111
# File 'lib/picasa/presenter/album.rb', line 109

def allow_prints
  @allow_prints ||= map_to_boolean(safe_retrieve(parsed_body, "gphoto$allowPrints"))
end

#authorPresenter::Author


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

def author
  @author ||= Author.new(parsed_body["author"][0])
end

#entriesArray<Presenter::Photo> Also known as: photos


12
13
14
# File 'lib/picasa/presenter/album.rb', line 12

def entries
  @entries ||= array_wrap(safe_retrieve(parsed_body, "entry")).map { |photo| Photo.new(photo) }
end

#etagString


43
44
45
# File 'lib/picasa/presenter/album.rb', line 43

def etag
  @etag ||= safe_retrieve(parsed_body, "gd$etag")
end

#idString


69
70
71
# File 'lib/picasa/presenter/album.rb', line 69

def id
  @id ||= safe_retrieve(parsed_body, "gphoto$id")
end

18
19
20
# File 'lib/picasa/presenter/album.rb', line 18

def links
  @links ||= array_wrap(safe_retrieve(parsed_body, "link")).map { |link| Link.new(link) }
end

#locationString


79
80
81
# File 'lib/picasa/presenter/album.rb', line 79

def location
  @location ||= safe_retrieve(parsed_body, "gphoto$location")
end

#mediaPresenter::Media


28
29
30
# File 'lib/picasa/presenter/album.rb', line 28

def media
  @media ||= Media.new(safe_retrieve(parsed_body, "media$group"))
end

#nameString


74
75
76
# File 'lib/picasa/presenter/album.rb', line 74

def name
  @name ||= safe_retrieve(parsed_body, "gphoto$name")
end

#nicknameString


104
105
106
# File 'lib/picasa/presenter/album.rb', line 104

def nickname
  @nickname ||= safe_retrieve(parsed_body, "gphoto$nickname")
end

#numphotosString


94
95
96
# File 'lib/picasa/presenter/album.rb', line 94

def numphotos
  @numphotos ||= map_to_integer(safe_retrieve(parsed_body, "gphoto$numphotos"))
end

#publishedDateTime


33
34
35
# File 'lib/picasa/presenter/album.rb', line 33

def published
  @published ||= map_to_date(safe_retrieve(parsed_body, "published"))
end

#rightsString


64
65
66
# File 'lib/picasa/presenter/album.rb', line 64

def rights
  @rights ||= safe_retrieve(parsed_body, "rights")
end

#subtitleString

Picasa API is not consistent - in show API this field contains summary


59
60
61
# File 'lib/picasa/presenter/album.rb', line 59

def subtitle
  @subtitle ||= safe_retrieve(parsed_body, "subtitle")
end

#summaryString


53
54
55
# File 'lib/picasa/presenter/album.rb', line 53

def summary
  @summary ||= safe_retrieve(parsed_body, "summary")
end

#timestampString


89
90
91
# File 'lib/picasa/presenter/album.rb', line 89

def timestamp
  @timestamp ||= (safe_retrieve(parsed_body, "gphoto$timestamp").to_i / 1000).to_s
end

#titleString


48
49
50
# File 'lib/picasa/presenter/album.rb', line 48

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

#total_resultsInteger


23
24
25
# File 'lib/picasa/presenter/album.rb', line 23

def total_results
  @total_results ||= map_to_integer(safe_retrieve(parsed_body, "openSearch$totalResults"))
end

#updatedDateTime


38
39
40
# File 'lib/picasa/presenter/album.rb', line 38

def updated
  @updated ||= map_to_date(safe_retrieve(parsed_body, "updated"))
end

#userString


99
100
101
# File 'lib/picasa/presenter/album.rb', line 99

def user
  @user ||= safe_retrieve(parsed_body, "gphoto$user")
end