Class: OrigenTesters::Decompiler::Pattern::Frontmatter

Inherits:
Base
  • Object
show all
Defined in:
lib/origen_testers/decompiler/pattern/elements/frontmatter.rb

Instance Attribute Summary

Attributes inherited from Base

#context, #node

Instance Method Summary collapse

Methods inherited from Base

#[], #execute!, #method_missing, #pinlist, #platform_nodes

Constructor Details

#initialize(node:, context:) ⇒ Frontmatter



7
8
9
10
# File 'lib/origen_testers/decompiler/pattern/elements/frontmatter.rb', line 7

def initialize(node:, context:)
  @source = :frontmatter
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OrigenTesters::Decompiler::Pattern::Base

Instance Method Details

#commentsArray

Note:

This will <u>NOT</u> include the comment_header.

Returns all the comments, in the order they appear.



26
27
28
# File 'lib/origen_testers/decompiler/pattern/elements/frontmatter.rb', line 26

def comments
  processor.comments
end

#pattern_headerArray

Returns the topmost comment block.



15
16
17
# File 'lib/origen_testers/decompiler/pattern/elements/frontmatter.rb', line 15

def pattern_header
  processor.pattern_header
end

#to_yaml_hashObject



30
31
32
33
34
35
36
37
38
# File 'lib/origen_testers/decompiler/pattern/elements/frontmatter.rb', line 30

def to_yaml_hash
  {
    class:          self.class.to_s,
    processor:      processor.class.to_s,
    pattern_header: pattern_header,
    comments:       comments,
    platform_nodes: _platform_nodes_
  }
end