Class: TRMNLP::Context
- Inherits:
-
Object
- Object
- TRMNLP::Context
- Defined in:
- lib/trmnlp/context.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#reporter ⇒ Object
readonly
Returns the value of attribute reporter.
Instance Method Summary collapse
-
#initialize(root_dir, reporter: Reporter.new) ⇒ Context
constructor
A new instance of Context.
-
#poller ⇒ Object
Context is the composition root: it wires and memoizes the runtime object graph.
- #renderer ⇒ Object
- #transform_pipeline ⇒ Object
- #user_data_assembler ⇒ Object
- #validate! ⇒ Object
- #watcher ⇒ Object
Constructor Details
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
14 15 16 |
# File 'lib/trmnlp/context.rb', line 14 def config @config end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
14 15 16 |
# File 'lib/trmnlp/context.rb', line 14 def paths @paths end |
#reporter ⇒ Object (readonly)
Returns the value of attribute reporter.
14 15 16 |
# File 'lib/trmnlp/context.rb', line 14 def reporter @reporter end |
Instance Method Details
#poller ⇒ Object
Context is the composition root: it wires and memoizes the runtime object graph. Callers take the collaborator they need and talk to it directly — Context does not forward methods on their behalf.
25 |
# File 'lib/trmnlp/context.rb', line 25 def poller = @poller ||= Poller.new(config:, paths:, reporter:) |
#renderer ⇒ Object
28 |
# File 'lib/trmnlp/context.rb', line 28 def renderer = @renderer ||= Renderer.new(config:, paths:, user_data_assembler:) |
#transform_pipeline ⇒ Object
26 |
# File 'lib/trmnlp/context.rb', line 26 def transform_pipeline = @transform_pipeline ||= TransformPipeline.new(config:, paths:, reporter:) |
#user_data_assembler ⇒ Object
27 |
# File 'lib/trmnlp/context.rb', line 27 def user_data_assembler = @user_data_assembler ||= UserDataAssembler.new(config:, paths:, transform_pipeline:) |
#validate! ⇒ Object
31 32 33 |
# File 'lib/trmnlp/context.rb', line 31 def validate! raise NotAPlugin, "not a plugin directory (did not find #{paths.trmnlp_config})" unless paths.valid? end |