Class: Inttegro::FileDownload

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/inttegro/file_download.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (readonly)

Returns the value of attribute data.



13
14
15
# File 'lib/inttegro/file_download.rb', line 13

def data
  @data
end

#headersObject (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