Class: BaUpload::ErrorFile
- Inherits:
-
Object
- Object
- BaUpload::ErrorFile
- Defined in:
- lib/ba_upload/error_file.rb
Direct Known Subclasses
Instance Method Summary collapse
- #filename ⇒ Object
-
#initialize(mechanize_link) ⇒ ErrorFile
constructor
A new instance of ErrorFile.
- #read ⇒ Object
- #tempfile ⇒ Object
Constructor Details
#initialize(mechanize_link) ⇒ ErrorFile
Returns a new instance of ErrorFile.
3 4 5 6 |
# File 'lib/ba_upload/error_file.rb', line 3 def initialize(mechanize_link) @mechanize_link = mechanize_link @link = mechanize_link.href end |
Instance Method Details
#filename ⇒ Object
13 14 15 |
# File 'lib/ba_upload/error_file.rb', line 13 def filename @mechanize_link.text end |
#read ⇒ Object
8 9 10 11 |
# File 'lib/ba_upload/error_file.rb', line 8 def read response = @mechanize_link.click response.xml.to_s end |
#tempfile ⇒ Object
17 18 19 20 21 22 |
# File 'lib/ba_upload/error_file.rb', line 17 def tempfile tf = Tempfile.new(['error_file', '.xml']) tf.write(read) tf.flush tf end |