Class: Longjing::PDDL::Predicate
- Inherits:
-
Object
- Object
- Longjing::PDDL::Predicate
- Defined in:
- lib/longjing/pddl/predicate.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, vars = nil) ⇒ Predicate
constructor
A new instance of Predicate.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, vars = nil) ⇒ Predicate
Returns a new instance of Predicate.
5 6 7 8 9 |
# File 'lib/longjing/pddl/predicate.rb', line 5 def initialize(name, vars=nil) @name = name @vars = vars || [] @hash = name.hash end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
4 5 6 |
# File 'lib/longjing/pddl/predicate.rb', line 4 def hash @hash end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/longjing/pddl/predicate.rb', line 4 def name @name end |
Instance Method Details
#inspect ⇒ Object
15 16 17 |
# File 'lib/longjing/pddl/predicate.rb', line 15 def inspect "(pred #{to_s})" end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/longjing/pddl/predicate.rb', line 11 def to_s "(#{[name, *@vars].join(' ')})" end |