Class: FunApi::Config
- Inherits:
-
Object
- Object
- FunApi::Config
- Defined in:
- lib/funapi/config.rb
Instance Attribute Summary collapse
-
#bind ⇒ Object
Returns the value of attribute bind.
-
#env ⇒ Object
Returns the value of attribute env.
-
#port ⇒ Object
Returns the value of attribute port.
-
#rack_app ⇒ Object
Returns the value of attribute rack_app.
-
#tls ⇒ Object
Returns the value of attribute tls.
-
#workers ⇒ Object
Returns the value of attribute workers.
Instance Method Summary collapse
-
#initialize(bind: "https://localhost", port: 9292, env: ENV.fetch("RACK_ENV", "development"), workers: nil, tls: {}, rack_app: nil) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(bind: "https://localhost", port: 9292, env: ENV.fetch("RACK_ENV", "development"), workers: nil, tls: {}, rack_app: nil) ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/funapi/config.rb', line 7 def initialize( bind: "https://localhost", # Falcon defaults to HTTPS in dev port: 9292, env: ENV.fetch("RACK_ENV", "development"), workers: nil, # let falcon default; can pass via --count tls: {}, # {cert:, key:} if you want to override rack_app: nil ) @bind = bind @port = port @env = env @workers = workers @tls = tls @rack_app = rack_app end |
Instance Attribute Details
#bind ⇒ Object
Returns the value of attribute bind.
5 6 7 |
# File 'lib/funapi/config.rb', line 5 def bind @bind end |
#env ⇒ Object
Returns the value of attribute env.
5 6 7 |
# File 'lib/funapi/config.rb', line 5 def env @env end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/funapi/config.rb', line 5 def port @port end |
#rack_app ⇒ Object
Returns the value of attribute rack_app.
5 6 7 |
# File 'lib/funapi/config.rb', line 5 def rack_app @rack_app end |
#tls ⇒ Object
Returns the value of attribute tls.
5 6 7 |
# File 'lib/funapi/config.rb', line 5 def tls @tls end |
#workers ⇒ Object
Returns the value of attribute workers.
5 6 7 |
# File 'lib/funapi/config.rb', line 5 def workers @workers end |