Class: Satisfactory::UpstreamRecordFinder Private
- Inherits:
-
Object
- Object
- Satisfactory::UpstreamRecordFinder
- Defined in:
- lib/satisfactory/upstream_record_finder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Finds the upstream record of a given type.
Defined Under Namespace
Classes: MissingUpstreamRecordError
Instance Attribute Summary collapse
- #upstream ⇒ Object private
Instance Method Summary collapse
-
#create ⇒ Hash<Symbol, Array<ApplicationRecord>>
Delegates to the upstream record.
-
#find(type) ⇒ Satisfactory::Record, ...
private
Find the upstream record of the given type.
-
#initialize(upstream:) ⇒ UpstreamRecordFinder
constructor
private
A new instance of UpstreamRecordFinder.
-
#to_plan ⇒ Satisfactory::Record, Satisfactory::Collection
Delegates to the upstream record.
-
#with(*args, **kwargs) ⇒ Satisfactory::Record, Satisfactory::Collection
private
Add an associated record to this record’s build plan.
-
#with_new ⇒ Satisfactory::Record, Satisfactory::Collection
Delegates to the upstream record.
Constructor Details
#initialize(upstream:) ⇒ UpstreamRecordFinder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of UpstreamRecordFinder.
6 7 8 |
# File 'lib/satisfactory/upstream_record_finder.rb', line 6 def initialize(upstream:) @upstream = upstream end |
Instance Attribute Details
#upstream ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/satisfactory/upstream_record_finder.rb', line 11 def upstream @upstream end |
Instance Method Details
#create ⇒ Hash<Symbol, Array<ApplicationRecord>>
Delegates to the upstream record.
25 |
# File 'lib/satisfactory/upstream_record_finder.rb', line 25 delegate :create, :with_new, :to_plan, to: :upstream |
#find(type) ⇒ Satisfactory::Record, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Find the upstream record of the given type.
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/satisfactory/upstream_record_finder.rb', line 32 def find(type) raise MissingUpstreamRecordError, type if upstream.nil? if type == upstream.type self else self.upstream = upstream.upstream find(type) end end |
#to_plan ⇒ Satisfactory::Record, Satisfactory::Collection
Delegates to the upstream record.
25 |
# File 'lib/satisfactory/upstream_record_finder.rb', line 25 delegate :create, :with_new, :to_plan, to: :upstream |
#with(*args, **kwargs) ⇒ Satisfactory::Record, Satisfactory::Collection
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Add an associated record to this record’s build plan.
44 45 46 |
# File 'lib/satisfactory/upstream_record_finder.rb', line 44 def with(*args, **kwargs) upstream.with(*args, force: true, **kwargs) end |
#with_new ⇒ Satisfactory::Record, Satisfactory::Collection
Delegates to the upstream record.
25 |
# File 'lib/satisfactory/upstream_record_finder.rb', line 25 delegate :create, :with_new, :to_plan, to: :upstream |