Class: DuoRuby::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/duoruby/config.rb

Overview

Holds framework-level configuration set by the application’s duoruby.rb.

Examples:

In <root>/duoruby.rb

DuoRuby.configure do |c|
  c.title = "My App"
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



26
27
28
29
30
# File 'lib/duoruby/config.rb', line 26

def initialize
  @title = "DuoRuby"
  @frontend_gems = []
  @frontend_stubs = []
end

Instance Attribute Details

#frontend_gemsArray<String>

Returns extra gems whose Opal sources are added to the frontend build.

Returns:

  • (Array<String>)

    extra gems whose Opal sources are added to the frontend build



21
22
23
# File 'lib/duoruby/config.rb', line 21

def frontend_gems
  @frontend_gems
end

#frontend_stubsArray<String>

Returns paths to stub (compile as empty) in the frontend Opal build.

Returns:

  • (Array<String>)

    paths to stub (compile as empty) in the frontend Opal build



24
25
26
# File 'lib/duoruby/config.rb', line 24

def frontend_stubs
  @frontend_stubs
end

#hostString?

Returns the server host, set by the framework before loading the app.

Returns:

  • (String, nil)

    the server host, set by the framework before loading the app



15
16
17
# File 'lib/duoruby/config.rb', line 15

def host
  @host
end

#portInteger?

Returns the server port, set by the framework before loading the app.

Returns:

  • (Integer, nil)

    the server port, set by the framework before loading the app



18
19
20
# File 'lib/duoruby/config.rb', line 18

def port
  @port
end

#titleString

Returns the window title used by duoruby launch.

Returns:

  • (String)

    the window title used by duoruby launch



12
13
14
# File 'lib/duoruby/config.rb', line 12

def title
  @title
end