Class: Twimage::Image
- Inherits:
-
Object
- Object
- Twimage::Image
- Defined in:
- lib/twimage/image.rb
Instance Attribute Summary collapse
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#service_url ⇒ Object
readonly
Returns the value of attribute service_url.
-
#tempfile ⇒ Object
readonly
Returns the value of attribute tempfile.
Instance Method Summary collapse
-
#initialize(options) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(options) ⇒ Image
Returns a new instance of Image.
6 7 8 9 10 11 12 13 14 |
# File 'lib/twimage/image.rb', line 6 def initialize() @service = [:service] @service_url = [:service_url] @image_url = [:image_url] extension = @image_url.match(/(\.\w+)(\?|$)/)[1] @tempfile = Tempfile.new(['twimage', extension]) @tempfile << [:image] end |
Instance Attribute Details
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
4 5 6 |
# File 'lib/twimage/image.rb', line 4 def image_url @image_url end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
4 5 6 |
# File 'lib/twimage/image.rb', line 4 def service @service end |
#service_url ⇒ Object (readonly)
Returns the value of attribute service_url.
4 5 6 |
# File 'lib/twimage/image.rb', line 4 def service_url @service_url end |
#tempfile ⇒ Object (readonly)
Returns the value of attribute tempfile.
4 5 6 |
# File 'lib/twimage/image.rb', line 4 def tempfile @tempfile end |