lib/elsmore/resource.rb in elsmore-0.1.7 vs lib/elsmore/resource.rb in elsmore-0.2.0

- old
+ new

@@ -1,21 +1,22 @@ -require 'open-uri' +require 'httparty' module Elsmore class Resource - attr_accessor :url, :filename + attr_accessor :url, :filename, :emitter def initialize url, parent self.url = Elsmore::Url.new(url, parent) end def write! writer = Elsmore::Writer.new(self) + writer.emitter = emitter writer.write self.filename = writer.canonical_filename end def data - @data ||= open(url.canonical_url).read + @data ||= HTTParty.get(url.canonical_url) end end end