Class: Ast::Merge::PartialTemplateMergerBase::Result
- Inherits:
-
Object
- Object
- Ast::Merge::PartialTemplateMergerBase::Result
- Defined in:
- lib/ast/merge/partial_template_merger_base.rb
Overview
Result of a partial template merge
Instance Attribute Summary collapse
-
#changed ⇒ Boolean
readonly
Whether the content changed.
-
#content ⇒ String
readonly
The merged content.
-
#has_section ⇒ Boolean
readonly
Whether the destination had a matching section.
-
#injection_point ⇒ InjectionPoint?
readonly
The injection point found (if any).
-
#message ⇒ String?
readonly
Message about the merge.
-
#stats ⇒ Hash
readonly
Statistics about the merge.
Instance Method Summary collapse
-
#initialize(content:, has_section:, changed:, stats: {}, injection_point: nil, message: nil) ⇒ Result
constructor
A new instance of Result.
-
#section_found? ⇒ Boolean
Whether a section was found.
Constructor Details
#initialize(content:, has_section:, changed:, stats: {}, injection_point: nil, message: nil) ⇒ Result
Returns a new instance of Result.
42 43 44 45 46 47 48 49 |
# File 'lib/ast/merge/partial_template_merger_base.rb', line 42 def initialize(content:, has_section:, changed:, stats: {}, injection_point: nil, message: nil) @content = content @has_section = has_section @changed = changed @stats = stats @injection_point = injection_point @message = end |
Instance Attribute Details
#changed ⇒ Boolean (readonly)
Returns Whether the content changed.
31 32 33 |
# File 'lib/ast/merge/partial_template_merger_base.rb', line 31 def changed @changed end |
#content ⇒ String (readonly)
Returns The merged content.
25 26 27 |
# File 'lib/ast/merge/partial_template_merger_base.rb', line 25 def content @content end |
#has_section ⇒ Boolean (readonly)
Returns Whether the destination had a matching section.
28 29 30 |
# File 'lib/ast/merge/partial_template_merger_base.rb', line 28 def has_section @has_section end |
#injection_point ⇒ InjectionPoint? (readonly)
Returns The injection point found (if any).
37 38 39 |
# File 'lib/ast/merge/partial_template_merger_base.rb', line 37 def injection_point @injection_point end |
#message ⇒ String? (readonly)
Returns Message about the merge.
40 41 42 |
# File 'lib/ast/merge/partial_template_merger_base.rb', line 40 def @message end |
#stats ⇒ Hash (readonly)
Returns Statistics about the merge.
34 35 36 |
# File 'lib/ast/merge/partial_template_merger_base.rb', line 34 def stats @stats end |
Instance Method Details
#section_found? ⇒ Boolean
Returns Whether a section was found.
52 53 54 |
# File 'lib/ast/merge/partial_template_merger_base.rb', line 52 def section_found? has_section end |