Class: Ruflet::App

Inherits:
Object
  • Object
show all
Defined in:
lib/ruflet_ui/ruflet/app.rb

Instance Method Summary collapse

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

#runObject



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

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/ruflet_ui/ruflet/app.rb', line 16

def view(_page)
  raise NotImplementedError, "#{self.class} must implement #view(page)"
end