class Plugin::Photo::InnerPhoto

Public Class Methods

[](uri) click to toggle source
# File core/plugin/photo/model/inner_photo.rb, line 12
def self.[](uri)
  case uri
  when Photo
    uri.maximum_original
  when Diva::Model
    uri
  when URI, Addressable::URI, Diva::URI, String
    wrapped_uri = Diva::URI(uri)
    photos[wrapped_uri.to_s.hash] ||= new(perma_link: wrapped_uri)
  end
end
new(*params) click to toggle source
Calls superclass method Diva::Model::PhotoMixin.new
# File core/plugin/photo/model/inner_photo.rb, line 24
def initialize(*params)
  super
  self.class.photos[uri.to_s.hash] = self
end
photos() click to toggle source
# File core/plugin/photo/model/inner_photo.rb, line 8
def self.photos
  @photos ||= TimeLimitedStorage.new(Integer, self)
end