Class: KBS::Condition

Inherits:
Object
  • Object
show all
Defined in:
lib/kbs/condition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#negatedObject (readonly)

Returns the value of attribute negated.



5
6
7
# File 'lib/kbs/condition.rb', line 5

def negated
  @negated
end

#patternObject (readonly)

Returns the value of attribute pattern.



5
6
7
# File 'lib/kbs/condition.rb', line 5

def pattern
  @pattern
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/kbs/condition.rb', line 5

def type
  @type
end

#variable_bindingsObject (readonly)

Returns the value of attribute variable_bindings.



5
6
7
# File 'lib/kbs/condition.rb', line 5

def variable_bindings
  @variable_bindings
end