Class: Square::FileWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/square/utilities/file_wrapper.rb

Overview

A utility to allow users to set the content-type for files

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, content_type: 'application/octet-stream') ⇒ FileWrapper

Returns a new instance of FileWrapper.



6
7
8
9
# File 'lib/square/utilities/file_wrapper.rb', line 6

def initialize(file, content_type: 'application/octet-stream')
  @file = file
  @content_type = content_type
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



4
5
6
# File 'lib/square/utilities/file_wrapper.rb', line 4

def content_type
  @content_type
end

#fileObject (readonly)

Returns the value of attribute file.



4
5
6
# File 'lib/square/utilities/file_wrapper.rb', line 4

def file
  @file
end