Class: ProgramR::Srai

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

Instance Method Summary collapse

Methods inherited from AimlTag

#inspect, #to_s

Constructor Details

#initialize(anObj = nil) ⇒ Srai


357
358
359
360
# File 'lib/programr/aiml_elements.rb', line 357

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

Instance Method Details

#add(anObj) ⇒ Object


362
363
364
# File 'lib/programr/aiml_elements.rb', line 362

def add anObj
  @pattern.push anObj
end

#patternObject Also known as: to_inspect


366
367
368
# File 'lib/programr/aiml_elements.rb', line 366

def pattern
  @pattern.map(&:to_s).join('').strip
end