diff --git a/src/xml/attributes.cr b/src/xml/attributes.cr index 10fd2b558e22..5b25fd33c29a 100644 --- a/src/xml/attributes.cr +++ b/src/xml/attributes.cr @@ -1,6 +1,6 @@ require "./node" -struct XML::Attributes +class XML::Attributes include Enumerable(Node) def initialize(@node : Node) diff --git a/src/xml/builder.cr b/src/xml/builder.cr index 4597314ed99d..fecc9e50d119 100644 --- a/src/xml/builder.cr +++ b/src/xml/builder.cr @@ -4,7 +4,7 @@ # an invalid XML (for example, if invoking `end_element` # without a matching `start_element`, or trying to use # a non-string value as an object's field name) -struct XML::Builder +class XML::Builder private CDATA_END = "]]>" private CDATA_ESCAPE = "]]]]>" diff --git a/src/xml/namespace.cr b/src/xml/namespace.cr index 5bcd22995fa8..95b0115170fb 100644 --- a/src/xml/namespace.cr +++ b/src/xml/namespace.cr @@ -1,4 +1,4 @@ -struct XML::Namespace +class XML::Namespace getter document : Node def initialize(@document : Node, @ns : LibXML::NS*) diff --git a/src/xml/node.cr b/src/xml/node.cr index bed80378d35a..4ec9540b711e 100644 --- a/src/xml/node.cr +++ b/src/xml/node.cr @@ -1,4 +1,4 @@ -struct XML::Node +class XML::Node LOOKS_LIKE_XPATH = /^(\.\/|\/|\.\.|\.$)/ # Creates a new node. diff --git a/src/xml/node/type.cr b/src/xml/node/type.cr index 32d0d0c69da6..1945b756477d 100644 --- a/src/xml/node/type.cr +++ b/src/xml/node/type.cr @@ -1,4 +1,4 @@ -struct XML::Node +class XML::Node enum Type NONE = 0 ELEMENT_NODE = 1 diff --git a/src/xml/node_set.cr b/src/xml/node_set.cr index 33b7afbf2d8a..7d26f5520b82 100644 --- a/src/xml/node_set.cr +++ b/src/xml/node_set.cr @@ -1,4 +1,4 @@ -struct XML::NodeSet +class XML::NodeSet include Enumerable(Node) def initialize(@doc : Node, @set : LibXML::NodeSet*) diff --git a/src/xml/reader.cr b/src/xml/reader.cr index b5f8e8af42cd..f48873bdedce 100644 --- a/src/xml/reader.cr +++ b/src/xml/reader.cr @@ -1,7 +1,7 @@ require "./libxml2" require "./parser_options" -struct XML::Reader +class XML::Reader # Creates a new reader from a string. # # See `XML::ParserOptions.default` for default options. diff --git a/src/xml/reader/type.cr b/src/xml/reader/type.cr index 50c156a08143..6c618745773d 100644 --- a/src/xml/reader/type.cr +++ b/src/xml/reader/type.cr @@ -1,4 +1,4 @@ -struct XML::Reader +class XML::Reader enum Type NONE = 0 ELEMENT = 1 diff --git a/src/xml/xpath_context.cr b/src/xml/xpath_context.cr index f6509237e023..e416f67c931d 100644 --- a/src/xml/xpath_context.cr +++ b/src/xml/xpath_context.cr @@ -1,4 +1,4 @@ -struct XML::XPathContext +class XML::XPathContext def initialize(node : Node) @ctx = LibXML.xmlXPathNewContext(node.to_unsafe.value.doc) @ctx.value.node = node.to_unsafe