Sha256: 7f2425e9a831cbed0a53f4785dac55663d87a5502f51bc3744fb18589ba17dc1

Contents?: true

Size: 487 Bytes

Versions: 2

Compression:

Stored size: 487 Bytes

Contents

# frozen_string_literal: true

module XAIML
  module Element
    class Base < XAIML::Document
      attr_accessor :element

      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

      def write
        Ox.dump(@element)
      end

      def self.allowed_object
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xaiml-0.1.5 lib/xaiml/element/base.rb
xaiml-0.1.4 lib/xaiml/element/base.rb