aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/body_parts/open_uri.rb
blob: 8ebd17b4a1433358138efd04f465cd2e47b01a69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'action_view/body_parts/threaded'
require 'open-uri'

module ActionView
  module BodyParts
    class OpenUri < Threaded
      def initialize(url)
        url = URI::Generic === url ? url : URI.parse(url)
        super(true) { |parts| parts << url.read }
      end
    end
  end
end