Class: XAIML::Element::Base
- Defined in:
- lib/xaiml/element/base.rb
Direct Known Subclasses
Arg, Calc, Category, Command, Condition, ConditionalRandom, Ext, Get, Li, Log, Loop, Map, Matcher, Name, Pattern, Predstore, Set, Srai, Sraix, 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
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.
6 7 8 9 10 11 12 |
# File 'lib/xaiml/element/base.rb', line 6 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.
4 5 6 |
# File 'lib/xaiml/element/base.rb', line 4 def element @element end |
Instance Method Details
#write ⇒ Object
14 15 16 |
# File 'lib/xaiml/element/base.rb', line 14 def write Ox.dump(@element) end |