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)


2084
2085
2086
2087
2088
# File 'lib/udb/condition.rb', line 2084

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:



2091
2092
2093
2094
2095
2096
2097
2098
# File 'lib/udb/condition.rb', line 2091

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)


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

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

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

Returns:

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


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

def to_h = constraint.to_h

#to_idl(cfg_arch) ⇒ String

Parameters:

Returns:

  • (String)


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

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

#to_logic_tree_internalLogicNode

Returns:



2101
2102
2103
# File 'lib/udb/condition.rb', line 2101

def to_logic_tree_internal
  @logic_tree = constraint.to_logic_tree_internal
end