Class: ProgramR::Srai

Inherits:
Object
  • Object
show all
Defined in:
lib/programr/aiml_elements.rb

Instance Method Summary collapse

Constructor Details

#initialize(anObj = nil) ⇒ Srai

Returns a new instance of Srai.



244
245
246
247
# File 'lib/programr/aiml_elements.rb', line 244

def initialize(anObj=nil) 
  @pattern = [] 
  @pattern.push(anObj) if(anObj)
end

Instance Method Details

#add(anObj) ⇒ Object



248
# File 'lib/programr/aiml_elements.rb', line 248

def add(anObj); @pattern.push(anObj) end

#inspectObject



256
# File 'lib/programr/aiml_elements.rb', line 256

def inspect(); "srai -> #{pattern}" end

#patternObject



249
250
251
252
253
254
255
# File 'lib/programr/aiml_elements.rb', line 249

def pattern
  res = ''
  @pattern.each{|tocken|
    res += tocken.to_s
  }
  return res.strip
end