Module: PoiseApplicationPython::AppMixin::Resource
- Includes:
- PoiseApplication::AppMixin::Resource, PoisePython::PythonCommandMixin::Resource
- Included in:
- ServiceMixin::Resource
- Defined in:
- lib/poise_application_python/app_mixin.rb
Overview
A helper mixin for Python application resources.
Instance Attribute Summary collapse
- #app_state_python ⇒ Object
-
#parent_python ⇒ PoisePython::Resources::PythonRuntime::Resource?
Override the #parent_python from PythonCommandMixin to grok the application level parent as a default value.
Instance Method Summary collapse
-
#app_state_environment_python ⇒ Hash<String, String>
A merged hash of environment variables for both the application state and parent python.
Instance Attribute Details
#app_state_python ⇒ Object
44 45 46 47 48 49 |
# File 'lib/poise_application_python/app_mixin.rb', line 44 def app_state_python(python=Poise::NOT_PASSED) unless python == Poise::NOT_PASSED app_state[:python] = python end app_state[:python] end |
#parent_python ⇒ PoisePython::Resources::PythonRuntime::Resource?
Override the #parent_python from PythonCommandMixin to grok the application level parent as a default value.
39 |
# File 'lib/poise_application_python/app_mixin.rb', line 39 parent_attribute(:python, type: :python_runtime, optional: true, default: lazy { app_state_python.equal?(self) ? nil : app_state_python }) |
Instance Method Details
#app_state_environment_python ⇒ Hash<String, String>
A merged hash of environment variables for both the application state and parent python.
55 56 57 58 59 |
# File 'lib/poise_application_python/app_mixin.rb', line 55 def app_state_environment_python env = app_state_environment env = env.merge(parent_python.python_environment) if parent_python env end |