Class: ChemistryParadise::Sinatra
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- ChemistryParadise::Sinatra
- Defined in:
- lib/chemistry_paradise/sinatra/sinatra.rb
Constant Summary collapse
- USE_THIS_PORT =
#
USE_THIS_PORT
#
'4567'
Instance Method Summary collapse
-
#initialize ⇒ Sinatra
constructor
# === initialize ========================================================================= #.
-
#reset ⇒ Object
# === reset ========================================================================= #.
-
#return_default_header_and_title ⇒ Object
# === return_default_header_and_title ========================================================================= #.
Constructor Details
#initialize ⇒ Sinatra
#
initialize
#
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/chemistry_paradise/sinatra/sinatra.rb', line 40 def initialize super() reset if ::ChemistryParadise.is_on_roebe? require 'open' # ===================================================================== # # Tell us which port will be used: # ===================================================================== # target = "http://localhost:#{USE_THIS_PORT}/" e sfancy(target) Thread.new { Open.in_browser(target) {{ delay: '1.0 seconds' }} } end end |
Instance Method Details
#reset ⇒ Object
#
reset
#
59 60 |
# File 'lib/chemistry_paradise/sinatra/sinatra.rb', line 59 def reset end |
#return_default_header_and_title ⇒ Object
#
return_default_header_and_title
#
65 66 67 68 69 |
# File 'lib/chemistry_paradise/sinatra/sinatra.rb', line 65 def return_default_header_and_title '<html><title>'\ 'ChemistryParadise Web-API'\ '</title><body>' end |