Class: REXML::Attribute
- Inherits:
-
Object
- Object
- REXML::Attribute
- Defined in:
- lib/xmpp4r/rexmladdons.rb
Instance Method Summary collapse
-
#initialize(first, second = nil, parent = nil) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(first, second = nil, parent = nil) ⇒ Attribute
Returns a new instance of Attribute.
864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 |
# File 'lib/xmpp4r/rexmladdons.rb', line 864 def initialize( first, second=nil, parent=nil ) @normalized = @unnormalized = @element = nil if first.kind_of? Attribute self.name = first. @value = first.value if second.kind_of? Element @element = second else @element = first.element end elsif first.kind_of? String @element = parent if parent.kind_of? Element self.name = first @value = Text::normalize(second.to_s) else raise "illegal argument #{first.class.name} to Attribute constructor" end end |