class Resizing::PublicId

Public Class Methods

new(public_id) click to toggle source
# File lib/resizing/public_id.rb, line 3
def initialize public_id
  @public_id = public_id
  parsed
end

Public Instance Methods

empty?() click to toggle source
# File lib/resizing/public_id.rb, line 8
def empty?
  @public_id.to_s.empty?
end
filename() click to toggle source

temporary

# File lib/resizing/public_id.rb, line 25
def filename
  image_id
end
identifier() click to toggle source
# File lib/resizing/public_id.rb, line 29
def identifier
  "/projects/#{project_id}/upload/images/#{image_id}"
end
image_id() click to toggle source
# File lib/resizing/public_id.rb, line 12
def image_id
  parsed[:image_id] if parsed
end
project_id() click to toggle source
# File lib/resizing/public_id.rb, line 16
def project_id
  parsed[:project_id] if parsed
end
to_s() click to toggle source
# File lib/resizing/public_id.rb, line 33
def to_s
  @public_id.to_s
end
version() click to toggle source
# File lib/resizing/public_id.rb, line 20
def version
  parsed[:version] if parsed
end

Private Instance Methods

parsed() click to toggle source
# File lib/resizing/public_id.rb, line 39
def parsed
  return nil if @public_id.nil?
  unless defined? @parsed
    @parsed = Resizing.separate_public_id(@public_id)
    raise "type error #{@public_id}" if @parsed == nil
  end
  @parsed
end