Class: Ast::Merge::SourceRender::SynthesizedFragment
- Inherits:
-
Object
- Object
- Ast::Merge::SourceRender::SynthesizedFragment
- Defined in:
- lib/ast/merge/source_render/fragment.rb,
sig/ast/merge.rbs
Overview
Provider- or profile-generated source that does not exist in a revision.
Instance Attribute Summary collapse
-
#content ⇒ String
readonly
Returns the value of attribute content.
-
#metadata ⇒ Hash[untyped, untyped]
readonly
Returns the value of attribute metadata.
-
#producer ⇒ Symbol
readonly
Returns the value of attribute producer.
-
#reason ⇒ Symbol
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize(content:, reason:, producer:, metadata: {}) ⇒ SynthesizedFragment
constructor
A new instance of SynthesizedFragment.
- #kind ⇒ :synthesized
Constructor Details
#initialize(content:, reason:, producer:, metadata: {}) ⇒ SynthesizedFragment
Returns a new instance of SynthesizedFragment.
42 43 44 45 46 47 |
# File 'lib/ast/merge/source_render/fragment.rb', line 42 def initialize(content:, reason:, producer:, metadata: {}) @content = content.to_s.freeze @reason = normalized_identifier(reason, :reason) @producer = normalized_identifier(producer, :producer) @metadata = .to_h.freeze end |
Instance Attribute Details
#content ⇒ String (readonly)
Returns the value of attribute content.
40 41 42 |
# File 'lib/ast/merge/source_render/fragment.rb', line 40 def content @content end |
#metadata ⇒ Hash[untyped, untyped] (readonly)
Returns the value of attribute metadata.
40 41 42 |
# File 'lib/ast/merge/source_render/fragment.rb', line 40 def @metadata end |
#producer ⇒ Symbol (readonly)
Returns the value of attribute producer.
40 41 42 |
# File 'lib/ast/merge/source_render/fragment.rb', line 40 def producer @producer end |
#reason ⇒ Symbol (readonly)
Returns the value of attribute reason.
40 41 42 |
# File 'lib/ast/merge/source_render/fragment.rb', line 40 def reason @reason end |
Instance Method Details
#kind ⇒ :synthesized
49 50 51 |
# File 'lib/ast/merge/source_render/fragment.rb', line 49 def kind :synthesized end |