twimage 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/twimage/base.rb +3 -3
- data/lib/twimage/version.rb +1 -1
- metadata +1 -1
data/lib/twimage/base.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
module Twimage
|
2
2
|
class Base
|
3
3
|
|
4
|
-
attr_accessor :
|
4
|
+
attr_accessor :tempfile, :image_url, :service_url
|
5
5
|
|
6
6
|
def initialize(service_url)
|
7
7
|
response = HTTParty.get(@image_url)
|
8
8
|
puts response.code
|
9
9
|
if response.code == 200
|
10
|
-
@
|
11
|
-
@
|
10
|
+
@tempfile = Tempfile.new(['twimage','.jpg'])
|
11
|
+
@tempfile << response.body.force_encoding('utf-8')
|
12
12
|
else
|
13
13
|
raise ImageURLInvalid, "The image_url #{@image_url} was not found (returned a 404)"
|
14
14
|
end
|
data/lib/twimage/version.rb
CHANGED