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.
82 83 84 |
# File 'lib/hyperion/config.rb', line 82 def initialize(config) @config = config end |
Instance Method Details
#bind(value) ⇒ Object
‘bind` is the Puma-style alias for `host` — operators expect it.
87 88 89 |
# File 'lib/hyperion/config.rb', line 87 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.
106 107 108 109 |
# File 'lib/hyperion/config.rb', line 106 def tls_cert_path(path) require 'openssl' @config.tls_cert = OpenSSL::X509::Certificate.new(File.read(path)) end |
#tls_key_path(path) ⇒ Object
111 112 113 114 |
# File 'lib/hyperion/config.rb', line 111 def tls_key_path(path) require 'openssl' @config.tls_key = OpenSSL::PKey.read(File.read(path)) end |