Class: Inttegro::FileDownload
- Inherits:
-
Object
- Object
- Inttegro::FileDownload
- Extended by:
- T::Sig
- Defined in:
- lib/inttegro/file_download.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Instance Method Summary collapse
-
#initialize(data, headers = {}) ⇒ FileDownload
constructor
A new instance of FileDownload.
- #save_to(path) ⇒ Object
Constructor Details
#initialize(data, headers = {}) ⇒ FileDownload
Returns a new instance of FileDownload.
19 20 21 22 |
# File 'lib/inttegro/file_download.rb', line 19 def initialize(data, headers = {}) @data = data @headers = headers end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
13 14 15 |
# File 'lib/inttegro/file_download.rb', line 13 def data @data end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
16 17 18 |
# File 'lib/inttegro/file_download.rb', line 16 def headers @headers end |
Instance Method Details
#save_to(path) ⇒ Object
25 26 27 |
# File 'lib/inttegro/file_download.rb', line 25 def save_to(path) ::File.binwrite(path, data) end |