lib/iconoclasm/favicon.rb in iconoclasm-1.0.0 vs lib/iconoclasm/favicon.rb in iconoclasm-1.0.1

- old
+ new

@@ -12,12 +12,12 @@ def initialize(attributes = {}) @url = attributes[:url] @data = attributes[:data] @name = attributes[:name] || parse_name_from(@url) headers = attributes[:headers] - @content_type = attributes[:content_type] || headers ? headers.content_type : nil - @size = attributes[:content_length] || headers ? headers.content_length : nil + @content_type = attributes[:content_type] ? attributes[:content_type] : headers ? headers.content_type : nil + @size = attributes[:content_length] ? attributes[:content_length] : headers ? headers.content_length : nil @save_path = nil end def inspect "#<Iconoclasm::Favicon @url=#{url}, @name=#{name}, @content_type=#{content_type}, @size=#{size}, @save_path=#{save_path ? save_path : "nil"}>" @@ -56,11 +56,11 @@ end end def fetch_data response = get(url) - if response.response_code == 200 - response.body_str + if response.code == 200 + response.body else raise Iconoclasm::HTTPError.new(url, response) end end \ No newline at end of file