Class: XAIML::Element::Base
- Defined in:
- lib/xaiml/element/base.rb
Direct Known Subclasses
Arg, Bot, BotId, Calc, Category, Command, Condition, ConditionalRandom, Ext, Get, Li, Log, Loop, Map, Matcher, Name, Pattern, Predstore, Random, Set, Sr, Srai, Sraix, SraixTopic, Star, Template, That, Think, Topic, Ub, Ut, Utterance, Value
Instance Attribute Summary collapse
-
#element ⇒ Object
Returns the value of attribute element.
Attributes inherited from Document
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}, object = nil) ⇒ Base
constructor
A new instance of Base.
- #write ⇒ Object
Methods inherited from Document
#allowed_object?, #append_child, #append_into, load_file, #prepend_child
Constructor Details
#initialize(attributes = {}, object = nil) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 |
# File 'lib/xaiml/element/base.rb', line 8 def initialize(attributes = {}, object = nil) @element = Ox::Element.new(self.class.name.split("::").last.downcase) attributes.each do |k, v| @element[k] = v end append_child(object) if object end |
Instance Attribute Details
#element ⇒ Object
Returns the value of attribute element.
6 7 8 |
# File 'lib/xaiml/element/base.rb', line 6 def element @element end |
Class Method Details
.allowed_object ⇒ Object
20 21 |
# File 'lib/xaiml/element/base.rb', line 20 def self.allowed_object end |
Instance Method Details
#write ⇒ Object
16 17 18 |
# File 'lib/xaiml/element/base.rb', line 16 def write Ox.dump(@element) end |