Class: FileIO
- Inherits:
-
Object
- Object
- FileIO
- Defined in:
- lib/file_io.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
- #file_getter ⇒ Object
-
#initialize(file) ⇒ FileIO
constructor
A new instance of FileIO.
- #upload ⇒ Object
Constructor Details
#initialize(file) ⇒ FileIO
6 7 8 |
# File 'lib/file_io.rb', line 6 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/file_io.rb', line 5 def file @file end |
Instance Method Details
#file_getter ⇒ Object
14 15 16 |
# File 'lib/file_io.rb', line 14 def file_getter return @file end |
#upload ⇒ Object
9 10 11 12 13 |
# File 'lib/file_io.rb', line 9 def upload c = RestClient.post('https://file.io', :file => File.new(@file, "rb")) parse = JSON.parse(c) puts "Uploaded #{@file} to https://file.io/" << parse["key"] end |