Class: Ruflet::App
- Inherits:
-
Object
- Object
- Ruflet::App
- Defined in:
- lib/ruflet_ui/ruflet/app.rb
Instance Method Summary collapse
-
#initialize(host: nil, port: nil) ⇒ App
constructor
A new instance of App.
- #run ⇒ Object
- #view(_page) ⇒ Object
Constructor Details
#initialize(host: nil, port: nil) ⇒ App
Returns a new instance of App.
5 6 7 8 |
# File 'lib/ruflet_ui/ruflet/app.rb', line 5 def initialize(host: nil, port: nil) @host = (host || ENV["RUFLET_HOST"] || "0.0.0.0") @port = normalize_port(port || ENV["RUFLET_PORT"] || 8550) end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 |
# File 'lib/ruflet_ui/ruflet/app.rb', line 10 def run Ruflet.run(host: @host, port: @port) do |page| view(page) end end |
#view(_page) ⇒ Object
16 17 18 |
# File 'lib/ruflet_ui/ruflet/app.rb', line 16 def view(_page) raise NotImplementedError, "#{self.class} must implement #view(page)" end |