Class: I18nFlow::Splitter::Merger

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_flow/splitter/merger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(chunks) ⇒ Merger

Returns a new instance of Merger.



5
6
7
# File 'lib/i18n_flow/splitter/merger.rb', line 5

def initialize(chunks)
  @chunks = chunks
end

Instance Attribute Details

#chunksObject (readonly)

Returns the value of attribute chunks.



3
4
5
# File 'lib/i18n_flow/splitter/merger.rb', line 3

def chunks
  @chunks
end

Instance Method Details

#perform_merge!Object



13
14
15
16
17
# File 'lib/i18n_flow/splitter/merger.rb', line 13

def perform_merge!
  chunks.each do |chunk|
    append_chunk(chunk)
  end
end

#rootObject



9
10
11
# File 'lib/i18n_flow/splitter/merger.rb', line 9

def root
  @root ||= I18nFlow::YamlAstProxy.new_root
end

#to_yamlObject



19
20
21
# File 'lib/i18n_flow/splitter/merger.rb', line 19

def to_yaml
  root.parent.to_yaml
end