Exception: Netfira::WebConnect::RackApp::Exceptions::SendFile
- Defined in:
- lib/netfira/web_connect/rack_app/exceptions/send_file.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(path, content = nil) ⇒ SendFile
constructor
A new instance of SendFile.
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
#path ⇒ Object (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
#content ⇒ Object
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 |