Class: Oga::XML::Namespace
- Inherits:
-
Object
- Object
- Oga::XML::Namespace
- Defined in:
- lib/oga/xml/namespace.rb
Overview
The Namespace class contains information about XML namespaces such as the name and URI.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#==(other) ⇒ TrueClass|FalseClass
-
#initialize(options = {}) ⇒ Namespace
constructor
A new instance of Namespace.
-
#inspect ⇒ String
-
#to_s ⇒ String
Constructor Details
#initialize(options = {}) ⇒ Namespace
Returns a new instance of Namespace
16 17 18 19 |
# File 'lib/oga/xml/namespace.rb', line 16 def initialize( = {}) @name = [:name] @uri = [:uri] end |
Instance Attribute Details
#name ⇒ String
7 8 9 |
# File 'lib/oga/xml/namespace.rb', line 7 def name @name end |
#uri ⇒ String
10 11 12 |
# File 'lib/oga/xml/namespace.rb', line 10 def uri @uri end |
Instance Method Details
#==(other) ⇒ TrueClass|FalseClass
33 34 35 |
# File 'lib/oga/xml/namespace.rb', line 33 def ==(other) other.is_a?(self.class) && name == other.name && uri == other.uri end |
#inspect ⇒ String
27 28 29 |
# File 'lib/oga/xml/namespace.rb', line 27 def inspect "Namespace(name: #{name.inspect} uri: #{uri.inspect})" end |
#to_s ⇒ String
22 23 24 |
# File 'lib/oga/xml/namespace.rb', line 22 def to_s name.to_s end |