Class: KBS::Condition
- Inherits:
-
Object
- Object
- KBS::Condition
- Defined in:
- lib/kbs/condition.rb
Instance Attribute Summary collapse
-
#negated ⇒ Object
readonly
Returns the value of attribute negated.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#variable_bindings ⇒ Object
readonly
Returns the value of attribute variable_bindings.
Instance Method Summary collapse
-
#initialize(type, pattern = {}, negated: false) ⇒ Condition
constructor
A new instance of Condition.
Constructor Details
#initialize(type, pattern = {}, negated: false) ⇒ Condition
Returns a new instance of Condition.
7 8 9 10 11 12 |
# File 'lib/kbs/condition.rb', line 7 def initialize(type, pattern = {}, negated: false) @type = type @pattern = pattern @negated = negated @variable_bindings = extract_variables(pattern) end |
Instance Attribute Details
#negated ⇒ Object (readonly)
Returns the value of attribute negated.
5 6 7 |
# File 'lib/kbs/condition.rb', line 5 def negated @negated end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
5 6 7 |
# File 'lib/kbs/condition.rb', line 5 def pattern @pattern end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/kbs/condition.rb', line 5 def type @type end |
#variable_bindings ⇒ Object (readonly)
Returns the value of attribute variable_bindings.
5 6 7 |
# File 'lib/kbs/condition.rb', line 5 def variable_bindings @variable_bindings end |