class Passifier::UrlSource

Asset derived from a url Used to pull in the background images

Attributes

content[R]
filename[R]
name[R]
url[R]

Public Class Methods

new(name, url) click to toggle source

@param [String, Symbol] name The name of the asset @param [String] url The url to request the asset content from

# File lib/passifier/url_source.rb, line 14
def initialize(name, url)
  @name = name
  @url = url
  populate_content
end

Private Instance Methods

populate_content() click to toggle source
# File lib/passifier/url_source.rb, line 22
def populate_content
  uri = URI(@url)
  res = Net::HTTP.get_response(uri)
  @content = res.body   
end