Class: RubyProlog::Predicate
- Inherits:
-
Object
- Object
- RubyProlog::Predicate
- Defined in:
- lib/ruby-prolog/ruby-prolog.rb
Instance Attribute Summary collapse
-
#defs ⇒ Object
readonly
Returns the value of attribute defs.
Instance Method Summary collapse
- #[](*args) ⇒ Object
- #[]=(*a) ⇒ Object
-
#initialize(name) ⇒ Predicate
constructor
A new instance of Predicate.
- #inspect ⇒ Object
Constructor Details
#initialize(name) ⇒ Predicate
Returns a new instance of Predicate.
10 11 12 13 |
# File 'lib/ruby-prolog/ruby-prolog.rb', line 10 def initialize(name) @name = name @defs = [] end |
Instance Attribute Details
#defs ⇒ Object (readonly)
Returns the value of attribute defs.
8 9 10 |
# File 'lib/ruby-prolog/ruby-prolog.rb', line 8 def defs @defs end |
Instance Method Details
#[](*args) ⇒ Object
19 20 21 |
# File 'lib/ruby-prolog/ruby-prolog.rb', line 19 def [](*args) return Goal.new(self, args) end |
#[]=(*a) ⇒ Object
23 |
# File 'lib/ruby-prolog/ruby-prolog.rb', line 23 def []=(*a); end |
#inspect ⇒ Object
15 16 17 |
# File 'lib/ruby-prolog/ruby-prolog.rb', line 15 def inspect return @name.to_s end |