Class: Udb::IdlCondition

Inherits:
Condition show all
Defined in:
lib/udb/condition.rb

Instance Method Summary collapse

Constructor Details

#initialize(yaml, cfg_arch, input_file:, input_line:)

Parameters:

  • yaml (Hash{String => T.untyped})
  • cfg_arch (ConfiguredArchitecture)
  • input_file (Pathname, nil)
  • input_line (Integer, nil)


1763
1764
1765
1766
1767
# File 'lib/udb/condition.rb', line 1763

def initialize(yaml, cfg_arch, input_file:, input_line:)
  super(yaml, cfg_arch, input_file:, input_line:)

  raise "missing required key" unless T.cast(@yaml, T::Hash[String, T.untyped]).key?("idl()")
end

Instance Method Details

#constraintConstraint

Returns:



1770
1771
1772
1773
1774
1775
1776
1777
# File 'lib/udb/condition.rb', line 1770

def constraint
  @constraint ||= Constraint.new(
      T.cast(@yaml, T::Hash[String, T.untyped]).fetch("idl()"),
      input_file: @input_file,
      input_line: @input_line,
      cfg_arch: @cfg_arch
    )
end

#reasonString

Returns:

  • (String)


1752
# File 'lib/udb/condition.rb', line 1752

def reason = T.cast(@yaml, T::Hash[String, T.untyped]).fetch("reason")

#to_hHash{String => T.untyped}, Boolean

Returns:

  • (Hash{String => T.untyped}, Boolean)


1785
# File 'lib/udb/condition.rb', line 1785

def to_h = constraint.to_h

#to_idl(cfg_arch) ⇒ String

Parameters:

Returns:

  • (String)


1788
# File 'lib/udb/condition.rb', line 1788

def to_idl(cfg_arch) = T.cast(@yaml, T::Hash[String, T.untyped]).fetch("idl()")

#to_logic_tree_internalLogicNode

Returns:



1780
1781
1782
# File 'lib/udb/condition.rb', line 1780

def to_logic_tree_internal
  @logic_tree = constraint.to_logic_tree_internal
end