Class: Gitt::Parsers::Attributer
- Inherits:
-
Object
- Object
- Gitt::Parsers::Attributer
- Defined in:
- lib/gitt/parsers/attributer.rb
Overview
Extracts attributes from XML formatted content.
Instance Method Summary collapse
- #call(content) ⇒ Object
-
#initialize(keys = Core::EMPTY_ARRAY) ⇒ Attributer
constructor
A new instance of Attributer.
Constructor Details
#initialize(keys = Core::EMPTY_ARRAY) ⇒ Attributer
Returns a new instance of Attributer.
9 10 11 |
# File 'lib/gitt/parsers/attributer.rb', line 9 def initialize keys = Core::EMPTY_ARRAY @keys = keys end |
Instance Method Details
#call(content) ⇒ Object
13 14 15 16 17 |
# File 'lib/gitt/parsers/attributer.rb', line 13 def call content build String(content) rescue ArgumentError => error error..include?("invalid byte") ? build(content.scrub("?")) : raise end |