Class: ADSL::Spass::SpassTranslator::Predicate
- Includes:
- FOL
- Defined in:
- lib/adsl/spass/spass_translator.rb
Instance Attribute Summary collapse
-
#arity ⇒ Object
Returns the value of attribute arity.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #[](*args) ⇒ Object
-
#initialize(name, arity) ⇒ Predicate
constructor
A new instance of Predicate.
Constructor Details
#initialize(name, arity) ⇒ Predicate
Returns a new instance of Predicate.
21 22 23 24 |
# File 'lib/adsl/spass/spass_translator.rb', line 21 def initialize(name, arity) @name = name @arity = arity end |
Instance Attribute Details
#arity ⇒ Object
Returns the value of attribute arity.
17 18 19 |
# File 'lib/adsl/spass/spass_translator.rb', line 17 def arity @arity end |
#name ⇒ Object
Returns the value of attribute name.
17 18 19 |
# File 'lib/adsl/spass/spass_translator.rb', line 17 def name @name end |
Instance Method Details
#[](*args) ⇒ Object
26 27 28 29 |
# File 'lib/adsl/spass/spass_translator.rb', line 26 def [](*args) args = args.flatten return "#{@name}(#{ (1..@arity).map{ |i| "${#{i}}"}.join(", ") })".resolve_params(*args) end |