Class: Picasa::Presenter::Photo

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


73
74
75
# File 'lib/picasa/presenter/photo.rb', line 73

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

#album_idString


68
69
70
# File 'lib/picasa/presenter/photo.rb', line 68

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

#checksumString


93
94
95
# File 'lib/picasa/presenter/photo.rb', line 93

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

#comment_countInteger


113
114
115
# File 'lib/picasa/presenter/photo.rb', line 113

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

#commenting_enabledtrue, ...


108
109
110
# File 'lib/picasa/presenter/photo.rb', line 108

def commenting_enabled
  @commenting_enabled ||= map_to_boolean(safe_retrieve(parsed_body, "gphoto$commentingEnabled"))
end

#contentPresenter::Content


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

def content
  @content ||= Content.new(safe_retrieve(parsed_body, "content"))
end

#etagString


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

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

#exifExif


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

def exif
  @exif ||= Exif.new(safe_retrieve(parsed_body, "exif$tags"))
end

#heightInteger


83
84
85
# File 'lib/picasa/presenter/photo.rb', line 83

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

#idString


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

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

#image_versionInteger


103
104
105
# File 'lib/picasa/presenter/photo.rb', line 103

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

#latitudeFloat


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

def latitude
  @latitude ||= map_to_float(location && location.split(" ")[0])
end

#licenseString


118
119
120
# File 'lib/picasa/presenter/photo.rb', line 118

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

8
9
10
# File 'lib/picasa/presenter/photo.rb', line 8

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

#longitudeFloat


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

def longitude
  @longitude ||= map_to_float(location && location.split(" ")[1])
end

#mediaPresenter::Media


13
14
15
# File 'lib/picasa/presenter/photo.rb', line 13

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

#publishedDateTime


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

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

#sizeInteger


88
89
90
# File 'lib/picasa/presenter/photo.rb', line 88

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

#summaryString


63
64
65
# File 'lib/picasa/presenter/photo.rb', line 63

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

#timestampString


98
99
100
# File 'lib/picasa/presenter/photo.rb', line 98

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

#titleString


58
59
60
# File 'lib/picasa/presenter/photo.rb', line 58

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

#updatedDateTime


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

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

#video_status"pending", ...


123
124
125
# File 'lib/picasa/presenter/photo.rb', line 123

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

#widthInteger


78
79
80
# File 'lib/picasa/presenter/photo.rb', line 78

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