Class: I18nFlow::Parser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buffer, file_path: nil) ⇒ Parser

Returns a new instance of Parser.



8
9
10
11
# File 'lib/i18n_flow/parser.rb', line 8

def initialize(buffer, file_path: nil)
  @buffer = buffer
  @file_path = file_path
end

Instance Attribute Details

#bufferObject (readonly)

Returns the value of attribute buffer.



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

def buffer
  @buffer
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



6
7
8
# File 'lib/i18n_flow/parser.rb', line 6

def file_path
  @file_path
end

Instance Method Details

#parse!Object



13
14
15
# File 'lib/i18n_flow/parser.rb', line 13

def parse!
  parser.parse(buffer)
end

#rootObject



17
18
19
# File 'lib/i18n_flow/parser.rb', line 17

def root
  builder.root
end

#root_proxyObject



21
22
23
# File 'lib/i18n_flow/parser.rb', line 21

def root_proxy
  @root_proxy ||= I18nFlow::YamlAstProxy.create(root, file_path: file_path)
end