Files

Class/Module Index [+]

Quicksearch

Dragonfly::Utils

Public Instance Methods

new_tempfile(ext=nil, content=nil) click to toggle source
# File lib/dragonfly/utils.rb, line 9
def new_tempfile(ext=nil, content=nil)
  tempfile = ext ? Tempfile.new(['dragonfly', ".#{ext}"]) : Tempfile.new('dragonfly')
  tempfile.binmode
  tempfile.write(content) if content
  tempfile.close
  tempfile
end
symbolize_keys(hash) click to toggle source
# File lib/dragonfly/utils.rb, line 17
def symbolize_keys(hash)
  hash.inject({}) do |new_hash, (key, value)|
    new_hash[key.to_sym] = value
    new_hash
  end
end
uri_escape_segment(string) click to toggle source
# File lib/dragonfly/utils.rb, line 24
def uri_escape_segment(string)
  Rack::Utils.escape_path(string)
end
uri_unescape(string) click to toggle source
# File lib/dragonfly/utils.rb, line 28
def uri_unescape(string)
  URI.unescape(string)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.