Class: ReactEmailRails::RenderModes::Subprocess
- Inherits:
-
Object
- Object
- ReactEmailRails::RenderModes::Subprocess
- Defined in:
- lib/react_email_rails/render_modes/subprocess.rb
Direct Known Subclasses
Defined Under Namespace
Classes: CommandRunner
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(component:, props:, render_options: {}) ⇒ Subprocess
constructor
A new instance of Subprocess.
- #render ⇒ Object
Constructor Details
#initialize(component:, props:, render_options: {}) ⇒ Subprocess
Returns a new instance of Subprocess.
11 12 13 14 15 |
# File 'lib/react_email_rails/render_modes/subprocess.rb', line 11 def initialize(component:, props:, render_options: {}) @component = component @props = props @render_options = end |
Class Method Details
.healthy?(command:, timeout:) ⇒ Boolean
3 4 5 6 7 8 |
# File 'lib/react_email_rails/render_modes/subprocess.rb', line 3 def healthy?(command:, timeout:) result = CommandRunner.capture([*command, "--health"], timeout:) result.status.success? && ReactEmailRails::RenderProtocol.compatible_response?(JSON.parse(result.stdout)) rescue StandardError false end |
Instance Method Details
#render ⇒ Object
17 18 19 |
# File 'lib/react_email_rails/render_modes/subprocess.rb', line 17 def render run end |