Class: Hyperion::Config::DSL
- Inherits:
-
Object
- Object
- Hyperion::Config::DSL
- Defined in:
- lib/hyperion/config.rb
Overview
DSL receiver. Each method call on the DSL maps to a Config setter or to a hook registration. Unknown methods raise NoMethodError so typos surface immediately at boot rather than as silent ignores.
Instance Method Summary collapse
-
#bind(value) ⇒ Object
‘bind` is the Puma-style alias for `host` — operators expect it.
-
#initialize(config) ⇒ DSL
constructor
A new instance of DSL.
-
#tls_cert_path(path) ⇒ Object
‘tls_cert_path` / `tls_key_path` are convenience aliases that read the file off disk so the DSL stays terse.
- #tls_key_path(path) ⇒ Object
Constructor Details
#initialize(config) ⇒ DSL
Returns a new instance of DSL.
72 73 74 |
# File 'lib/hyperion/config.rb', line 72 def initialize(config) @config = config end |
Instance Method Details
#bind(value) ⇒ Object
‘bind` is the Puma-style alias for `host` — operators expect it.
77 78 79 |
# File 'lib/hyperion/config.rb', line 77 def bind(value) @config.host = value end |
#tls_cert_path(path) ⇒ Object
‘tls_cert_path` / `tls_key_path` are convenience aliases that read the file off disk so the DSL stays terse. The parsed cert/key are stored on the config and Server consumes them directly.
96 97 98 99 |
# File 'lib/hyperion/config.rb', line 96 def tls_cert_path(path) require 'openssl' @config.tls_cert = OpenSSL::X509::Certificate.new(File.read(path)) end |
#tls_key_path(path) ⇒ Object
101 102 103 104 |
# File 'lib/hyperion/config.rb', line 101 def tls_key_path(path) require 'openssl' @config.tls_key = OpenSSL::PKey.read(File.read(path)) end |