From e0bbc81351364ca258d225329d9e6ac9f44c715e Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 6 Aug 2014 00:00:08 +0200 Subject: [PATCH] Added a very basic Namespace class. --- lib/oga/xml/namespace.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/oga/xml/namespace.rb diff --git a/lib/oga/xml/namespace.rb b/lib/oga/xml/namespace.rb new file mode 100644 index 0000000..c23abd4 --- /dev/null +++ b/lib/oga/xml/namespace.rb @@ -0,0 +1,29 @@ +module Oga + module XML + ## + # The Namespace class contains information about XML namespaces such as the + # name and URI. + # + class Namespace + attr_accessor :name, :uri + + ## + # @param [Hash] options + # + # @option options [String] :name + # @option options [String] :uri + # + def initialize(options = {}) + @name = options[:name] + @uri = options[:uri] + end + + ## + # @return [String] + # + def to_s + return name.to_s + end + end # Namespace + end # XML +end # Oga