Class: Julewire::Core::RuntimeState

Inherits:
Data
  • Object
show all
Defined in:
lib/julewire/core/runtime_state.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration

Returns:

  • (Object)

    the current value of configuration



5
6
7
# File 'lib/julewire/core/runtime_state.rb', line 5

def configuration
  @configuration
end

#pipelineObject (readonly)

Returns the value of attribute pipeline

Returns:

  • (Object)

    the current value of pipeline



5
6
7
# File 'lib/julewire/core/runtime_state.rb', line 5

def pipeline
  @pipeline
end

#pipeline_closedObject (readonly)

Returns the value of attribute pipeline_closed

Returns:

  • (Object)

    the current value of pipeline_closed



5
6
7
# File 'lib/julewire/core/runtime_state.rb', line 5

def pipeline_closed
  @pipeline_closed
end

#pipeline_generationObject (readonly)

Returns the value of attribute pipeline_generation

Returns:

  • (Object)

    the current value of pipeline_generation



5
6
7
# File 'lib/julewire/core/runtime_state.rb', line 5

def pipeline_generation
  @pipeline_generation
end

Class Method Details

.default(invalid_severity_reporter: Diagnostics::InvalidSeverityReporter.counter) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/julewire/core/runtime_state.rb', line 12

def default(invalid_severity_reporter: Diagnostics::InvalidSeverityReporter.counter)
  configuration = Configuration.new.snapshot
  pipeline = configuration.build_pipeline(invalid_severity_reporter: invalid_severity_reporter)

  new(
    configuration: configuration,
    pipeline: pipeline,
    pipeline_closed: false,
    pipeline_generation: 0
  )
end

Instance Method Details

#closedObject



25
26
27
# File 'lib/julewire/core/runtime_state.rb', line 25

def closed
  with(pipeline_closed: true)
end

#next_generation(configuration:, pipeline:) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/julewire/core/runtime_state.rb', line 29

def next_generation(configuration:, pipeline:)
  self.class.new(
    configuration: configuration,
    pipeline: pipeline,
    pipeline_closed: false,
    pipeline_generation: pipeline_generation + 1
  )
end