Class: ProgramR::ReadOnlyTag
- Inherits:
-
Object
- Object
- ProgramR::ReadOnlyTag
- Defined in:
- lib/programr/aiml_elements.rb
Constant Summary collapse
- @@environment =
Environment.new
Instance Method Summary collapse
- #execute ⇒ Object (also: #to_s)
-
#initialize(aLocalname, someAttributes) ⇒ ReadOnlyTag
constructor
A new instance of ReadOnlyTag.
- #inspect ⇒ Object
Constructor Details
#initialize(aLocalname, someAttributes) ⇒ ReadOnlyTag
Returns a new instance of ReadOnlyTag.
204 205 206 207 208 209 210 211 |
# File 'lib/programr/aiml_elements.rb', line 204 def initialize(aLocalname,someAttributes) @localname = aLocalname.sub(/^get_/,'') if(someAttributes.key?('index') && @localname == 'that') @localname = 'justbeforethat' if someAttributes['index'] == '2,1' someAttributes = {} end @attributed = someAttributes end |
Instance Method Details
#execute ⇒ Object Also known as: to_s
213 214 215 216 |
# File 'lib/programr/aiml_elements.rb', line 213 def execute return @@environment.get(@localname) if(@attributed.empty?) @@environment.get(@attributed['name']) end |
#inspect ⇒ Object
218 219 220 |
# File 'lib/programr/aiml_elements.rb', line 218 def inspect() return "roTag #{@localname} -> #{execute}" end |