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.
20 21 22 23 |
# File 'lib/oga/xml/namespace.rb', line 20 def initialize( = {}) @name = [:name] @uri = [:uri] end |
Instance Attribute Details
#name ⇒ String
9 10 11 |
# File 'lib/oga/xml/namespace.rb', line 9 def name @name end |
#uri ⇒ String
12 13 14 |
# File 'lib/oga/xml/namespace.rb', line 12 def uri @uri end |
Instance Method Details
#==(other) ⇒ TrueClass|FalseClass
43 44 45 |
# File 'lib/oga/xml/namespace.rb', line 43 def ==(other) other.is_a?(self.class) && name == other.name && uri == other.uri end |
#inspect ⇒ String
35 36 37 |
# File 'lib/oga/xml/namespace.rb', line 35 def inspect "Namespace(name: #{name.inspect} uri: #{uri.inspect})" end |
#to_s ⇒ String
28 29 30 |
# File 'lib/oga/xml/namespace.rb', line 28 def to_s name.to_s end |