Class: PDFService::WebApp
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- PDFService::WebApp
- Defined in:
- lib/pdf_service/web_app.rb
Constant Summary collapse
- VALID_SCHEMES =
%w(http https).freeze
Instance Attribute Summary collapse
-
#pdf_service ⇒ Object
readonly
Returns the value of attribute pdf_service.
Instance Method Summary collapse
- #ErrorResponse(message, status: 500) ⇒ Object
-
#initialize(pdf_service:) ⇒ WebApp
constructor
A new instance of WebApp.
- #PDFResponse(pdf_data, status: 200) ⇒ Object
Constructor Details
#initialize(pdf_service:) ⇒ WebApp
Returns a new instance of WebApp.
7 8 9 10 |
# File 'lib/pdf_service/web_app.rb', line 7 def initialize(pdf_service:) super() @pdf_service = pdf_service end |
Instance Attribute Details
#pdf_service ⇒ Object (readonly)
Returns the value of attribute pdf_service.
12 13 14 |
# File 'lib/pdf_service/web_app.rb', line 12 def pdf_service @pdf_service end |
Instance Method Details
#ErrorResponse(message, status: 500) ⇒ Object
41 42 43 |
# File 'lib/pdf_service/web_app.rb', line 41 def ErrorResponse(, status: 500) [status, {'Content-Type' => 'text/plain'}, []] end |
#PDFResponse(pdf_data, status: 200) ⇒ Object
45 46 47 |
# File 'lib/pdf_service/web_app.rb', line 45 def PDFResponse(pdf_data, status: 200) [status, {'Content-Type' => 'application/pdf'}, [pdf_data]] end |