Exception: Netfira::WebConnect::RackApp::Exceptions::SendFile

Inherits:
Base
  • Object
show all
Defined in:
lib/netfira/web_connect/rack_app/exceptions/send_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, content = nil) ⇒ SendFile

Returns a new instance of SendFile.



6
7
8
9
# File 'lib/netfira/web_connect/rack_app/exceptions/send_file.rb', line 6

def initialize(path, content = nil)
  @path = path
  @content = content
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/netfira/web_connect/rack_app/exceptions/send_file.rb', line 4

def path
  @path
end

Instance Method Details

#contentObject



11
12
13
# File 'lib/netfira/web_connect/rack_app/exceptions/send_file.rb', line 11

def content
  @content ||= path.read.force_encoding('ASCII-8BIT')
end