Class: RubyProlog::Predicate

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-prolog/ruby-prolog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#defsObject (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

#inspectObject



15
16
17
# File 'lib/ruby-prolog/ruby-prolog.rb', line 15

def inspect
  return @name.to_s
end