Class: Udb::IdlCondition
- Inherits:
-
Condition
- Object
- AbstractCondition
- Condition
- Udb::IdlCondition
- Defined in:
- lib/udb/condition.rb
Instance Method Summary collapse
- #constraint ⇒ Constraint
- #initialize(yaml, cfg_arch, input_file:, input_line:) constructor
- #reason ⇒ String
- #to_h ⇒ Hash{String => T.untyped}, Boolean
- #to_idl(cfg_arch) ⇒ String
- #to_logic_tree_internal ⇒ LogicNode
Constructor Details
#initialize(yaml, cfg_arch, input_file:, input_line:)
1762 1763 1764 1765 1766 |
# File 'lib/udb/condition.rb', line 1762 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
#constraint ⇒ Constraint
1769 1770 1771 1772 1773 1774 1775 1776 |
# File 'lib/udb/condition.rb', line 1769 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 |
#reason ⇒ String
1751 |
# File 'lib/udb/condition.rb', line 1751 def reason = T.cast(@yaml, T::Hash[String, T.untyped]).fetch("reason") |
#to_h ⇒ Hash{String => T.untyped}, Boolean
1784 |
# File 'lib/udb/condition.rb', line 1784 def to_h = constraint.to_h |
#to_idl(cfg_arch) ⇒ String
1787 |
# File 'lib/udb/condition.rb', line 1787 def to_idl(cfg_arch) = T.cast(@yaml, T::Hash[String, T.untyped]).fetch("idl()") |
#to_logic_tree_internal ⇒ LogicNode
1779 1780 1781 |
# File 'lib/udb/condition.rb', line 1779 def to_logic_tree_internal @logic_tree = constraint.to_logic_tree_internal end |