Class: ETL::Parser::XPath::Element
- Defined in:
- lib/etl/parser/sax_parser.rb
Overview
:nodoc
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, attributes = {}) ⇒ Element
constructor
A new instance of Element.
- #to_s ⇒ Object
Constructor Details
#initialize(name, attributes = {}) ⇒ Element
Returns a new instance of Element.
200 201 202 203 |
# File 'lib/etl/parser/sax_parser.rb', line 200 def initialize(name, attributes={}) @name = name @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
199 200 201 |
# File 'lib/etl/parser/sax_parser.rb', line 199 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
198 199 200 |
# File 'lib/etl/parser/sax_parser.rb', line 198 def name @name end |
Instance Method Details
#to_s ⇒ Object
204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/etl/parser/sax_parser.rb', line 204 def to_s s = "#{name}" if !@attributes.empty? attr_str = @attributes.collect do |key,value| value = value.source if value.is_a?(Regexp) "#{key}=#{value}" end.join(",") s << "[" + attr_str + "]" end s end |