Module: Siding::Invocation
- Defined in:
- lib/siding/invocation.rb
Constant Summary collapse
- RESOLUTION_KEY =
"SIDING_RESOLUTION"- REVISION_KEY =
"SIDING_REVISION"- BOOT_SECONDS_KEY =
"SIDING_BOOT_SECONDS"- RESOLUTIONS =
%w[fresh reloaded_in_worker rebuild].freeze
Class Method Summary collapse
- .accelerated?(env = ENV) ⇒ Boolean
- .boot_seconds(env = ENV) ⇒ Object
- .resolution(env = ENV) ⇒ Object
- .revision(env = ENV) ⇒ Object
- .to_h(env = ENV) ⇒ Object
Class Method Details
.accelerated?(env = ENV) ⇒ Boolean
13 |
# File 'lib/siding/invocation.rb', line 13 def accelerated?(env = ENV) = !env[RESOLUTION_KEY].nil? |
.boot_seconds(env = ENV) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/siding/invocation.rb', line 17 def boot_seconds(env = ENV) value = env[BOOT_SECONDS_KEY] return nil if value.nil? || value.empty? Float(value) rescue ArgumentError, TypeError nil end |
.resolution(env = ENV) ⇒ Object
14 |
# File 'lib/siding/invocation.rb', line 14 def resolution(env = ENV) = env[RESOLUTION_KEY] |
.revision(env = ENV) ⇒ Object
15 |
# File 'lib/siding/invocation.rb', line 15 def revision(env = ENV) = env[REVISION_KEY] |
.to_h(env = ENV) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/siding/invocation.rb', line 26 def to_h(env = ENV) { accelerated: accelerated?(env), resolution: resolution(env), revision: revision(env), boot_seconds: boot_seconds(env) } end |