Class: Anyfetch::OpenURI
- Inherits:
-
Object
- Object
- Anyfetch::OpenURI
- Defined in:
- lib/anyfetch/open_uri.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ OpenURI
constructor
A new instance of OpenURI.
- #open ⇒ Object
Constructor Details
#initialize(*args) ⇒ OpenURI
Returns a new instance of OpenURI.
6 7 8 |
# File 'lib/anyfetch/open_uri.rb', line 6 def initialize(*args) raise NotImplementedError end |
Instance Method Details
#open ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/anyfetch/open_uri.rb', line 10 def open file = ::OpenURI.open_uri(@uri, @options) if file.is_a?(StringIO) file = to_tempfile(file) end file.extend(OriginalFilename::ContentType) file end |