Class: L10nizer::Processor
- Inherits:
-
Object
- Object
- L10nizer::Processor
- Defined in:
- lib/l10nizer/processor.rb
Instance Method Summary collapse
-
#initialize(html, keygen) ⇒ Processor
constructor
A new instance of Processor.
- #l10ns ⇒ Object
- #processed ⇒ Object
- #reformed ⇒ Object
Constructor Details
#initialize(html, keygen) ⇒ Processor
Returns a new instance of Processor.
6 7 8 9 |
# File 'lib/l10nizer/processor.rb', line 6 def initialize(html, keygen) @html = html @keygen = keygen end |
Instance Method Details
#l10ns ⇒ Object
11 12 13 |
# File 'lib/l10nizer/processor.rb', line 11 def l10ns processed.inject({}){ |hash, node| hash.merge(node.l10n) } end |
#processed ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/l10nizer/processor.rb', line 19 def processed @processed ||= HtmlErbParser.new. parse(@html). elements. map{ |e| NodeWrapperFactory.wrap(e, @keygen) } end |
#reformed ⇒ Object
15 16 17 |
# File 'lib/l10nizer/processor.rb', line 15 def reformed processed.map{ |e| e.to_s }.join end |