Class: ProgramR::Template

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTemplate

Returns a new instance of Template.



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

def initialize() @value = [] end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



43
44
45
# File 'lib/programr/aiml_elements.rb', line 43

def value
  @value
end

Instance Method Details

#add(anObj) ⇒ Object



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

def add(anObj) @value << anObj end

#append(aString) ⇒ Object



47
48
49
# File 'lib/programr/aiml_elements.rb', line 47

def append(aString)
  @value << aString.gsub(/\s+/, ' ')
end

#inspectObject



51
52
53
54
55
# File 'lib/programr/aiml_elements.rb', line 51

def inspect
  res = ''
  @value.each{|tocken| res += tocken.inspect }
  res
end