Class: ETL::Parser::XPath::Element
- Inherits:
-
Object
- Object
- ETL::Parser::XPath::Element
- Defined in:
- lib/etl/parser/sax_parser.rb
Overview
:nodoc
Instance Attribute Summary (collapse)
-
- (Object) attributes
readonly
Returns the value of attribute attributes.
-
- (Object) name
readonly
Returns the value of attribute name.
Instance Method Summary (collapse)
-
- (Element) initialize(name, attributes = {})
constructor
A new instance of Element.
- - (Object) to_s
Constructor Details
- (Element) initialize(name, attributes = {})
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
- (Object) attributes (readonly)
Returns the value of attribute attributes
199 200 201 |
# File 'lib/etl/parser/sax_parser.rb', line 199 def attributes @attributes end |
- (Object) name (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
- (Object) to_s
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 |