Method: Bio::FlatFile.open_uri
- Defined in:
- lib/bio/io/flatfile.rb
.open_uri(uri, *arg) ⇒ Object
Opens URI specified as uri. uri must be a String or URI object. *arg is passed to OpenURI.open_uri or URI#open.
Like FlatFile#open, it can accept a block.
Note that you MUST explicitly require ‘open-uri’. Because open-uri.rb modifies existing class, it isn’t required by default.
177 178 179 180 181 182 183 184 185 186 |
# File 'lib/bio/io/flatfile.rb', line 177 def self.open_uri(uri, *arg) if block_given? then BufferedInputStream.open_uri(uri, *arg) do |stream| yield self.new(nil, stream) end else stream = BufferedInputStream.open_uri(uri, *arg) self.new(nil, stream) end end |