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:)
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
#constraint ⇒ Constraint
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 |
#reason ⇒ String
1752 |
# File 'lib/udb/condition.rb', line 1752 def reason = T.cast(@yaml, T::Hash[String, T.untyped]).fetch("reason") |
#to_h ⇒ Hash{String => T.untyped}, Boolean
1785 |
# File 'lib/udb/condition.rb', line 1785 def to_h = constraint.to_h |
#to_idl(cfg_arch) ⇒ 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_internal ⇒ LogicNode
1780 1781 1782 |
# File 'lib/udb/condition.rb', line 1780 def to_logic_tree_internal @logic_tree = constraint.to_logic_tree_internal end |