Class: Ast::Merge::Ruleset::SurfaceDeclaration
- Inherits:
-
Object
- Object
- Ast::Merge::Ruleset::SurfaceDeclaration
- Defined in:
- lib/ast/merge/ruleset/surface_declaration.rb
Overview
Declarative description of a merge-relevant nested/embedded surface.
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#selector ⇒ Object
readonly
Returns the value of attribute selector.
Instance Method Summary collapse
-
#initialize(name:, selector:, metadata: {}) ⇒ SurfaceDeclaration
constructor
A new instance of SurfaceDeclaration.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, selector:, metadata: {}) ⇒ SurfaceDeclaration
Returns a new instance of SurfaceDeclaration.
10 11 12 13 14 |
# File 'lib/ast/merge/ruleset/surface_declaration.rb', line 10 def initialize(name:, selector:, metadata: {}) @name = name&.to_sym @selector = selector&.to_sym @metadata = .dup.freeze end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
8 9 10 |
# File 'lib/ast/merge/ruleset/surface_declaration.rb', line 8 def @metadata end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/ast/merge/ruleset/surface_declaration.rb', line 8 def name @name end |
#selector ⇒ Object (readonly)
Returns the value of attribute selector.
8 9 10 |
# File 'lib/ast/merge/ruleset/surface_declaration.rb', line 8 def selector @selector end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/ast/merge/ruleset/surface_declaration.rb', line 16 def to_h { name: name, selector: selector, metadata: }.compact end |