Class: Ast::Merge::PartialTemplateMergerBase::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/ast/merge/partial_template_merger_base.rb

Overview

Result of a partial template merge

Instance Attribute Summary collapse

Instance Method Summary collapse

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 = message
end

Instance Attribute Details

#changedBoolean (readonly)

Returns Whether the content changed.

Returns:

  • (Boolean)

    Whether the content changed



31
32
33
# File 'lib/ast/merge/partial_template_merger_base.rb', line 31

def changed
  @changed
end

#contentString (readonly)

Returns The merged content.

Returns:

  • (String)

    The merged content



25
26
27
# File 'lib/ast/merge/partial_template_merger_base.rb', line 25

def content
  @content
end

#has_sectionBoolean (readonly)

Returns Whether the destination had a matching section.

Returns:

  • (Boolean)

    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_pointInjectionPoint? (readonly)

Returns The injection point found (if any).

Returns:

  • (InjectionPoint, nil)

    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

#messageString? (readonly)

Returns Message about the merge.

Returns:

  • (String, nil)

    Message about the merge



40
41
42
# File 'lib/ast/merge/partial_template_merger_base.rb', line 40

def message
  @message
end

#statsHash (readonly)

Returns Statistics about the merge.

Returns:

  • (Hash)

    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.

Returns:

  • (Boolean)

    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