module Blobsterix::UrlHelper

Public Instance Methods

favicon() click to toggle source
# File lib/blobsterix/helper/url_helper.rb, line 4
def favicon
  @favicon ||= file.match /favicon/
end
file() click to toggle source
# File lib/blobsterix/helper/url_helper.rb, line 19
def file
  if format
    [env[nil][:file] || env[nil][:bucket_or_file] || "", format].join(".")
  else
    env[nil][:file] || env[nil][:bucket_or_file] || ""
  end
end
format() click to toggle source
# File lib/blobsterix/helper/url_helper.rb, line 37
def format
  @format ||= env[nil][:format]
end
included_bucket() click to toggle source
# File lib/blobsterix/helper/url_helper.rb, line 27
def included_bucket
  if env[nil][:bucket_or_file] && env[nil][:bucket_or_file].include?("/")
    env[nil][:bucket] = env[nil][:bucket_or_file].split("/")[0]
    env[nil][:bucket_or_file] = env[nil][:bucket_or_file].gsub("#{env[nil][:bucket]}/", "")
    true
  else
    false
  end
end
trafo(trafo_s='') click to toggle source

TransformationCommand

# File lib/blobsterix/helper/url_helper.rb, line 9
def trafo(trafo_s='')
  trafo_a = []
  trafo_s.split(",").each{|command|
    parts = command.split("_")
    key = parts.delete_at(0)
    trafo_a << [key, parts.join("_")]
  }
  trafo_a
end