Class: ProgramR::Srai
- Inherits:
-
Object
- Object
- ProgramR::Srai
- Defined in:
- lib/programr/aiml_elements.rb
Instance Method Summary collapse
- #add(anObj) ⇒ Object
-
#initialize(anObj = nil) ⇒ Srai
constructor
A new instance of Srai.
- #inspect ⇒ Object
- #pattern ⇒ Object
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 |
#inspect ⇒ Object
256 |
# File 'lib/programr/aiml_elements.rb', line 256 def inspect(); "srai -> #{pattern}" end |
#pattern ⇒ Object
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 |