Class: I18nFlow::Parser
- Inherits:
-
Object
- Object
- I18nFlow::Parser
- Defined in:
- lib/i18n_flow/parser.rb
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
Instance Method Summary collapse
-
#initialize(buffer, file_path: nil) ⇒ Parser
constructor
A new instance of Parser.
- #parse! ⇒ Object
- #root ⇒ Object
- #root_proxy ⇒ Object
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
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
5 6 7 |
# File 'lib/i18n_flow/parser.rb', line 5 def buffer @buffer end |
#file_path ⇒ Object (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 |
#root ⇒ Object
17 18 19 |
# File 'lib/i18n_flow/parser.rb', line 17 def root builder.root end |
#root_proxy ⇒ Object
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 |