Class: I18nFlow::Validator::FileScope
- Inherits:
-
Object
- Object
- I18nFlow::Validator::FileScope
- Defined in:
- lib/i18n_flow/validator/file_scope.rb
Instance Attribute Summary collapse
-
#ast ⇒ Object
readonly
Returns the value of attribute ast.
-
#filepath ⇒ Object
readonly
Returns the value of attribute filepath.
Instance Method Summary collapse
- #errors ⇒ Object
- #filepath_scopes ⇒ Object
-
#initialize(ast, filepath:) ⇒ FileScope
constructor
A new instance of FileScope.
- #validate! ⇒ Object
Constructor Details
#initialize(ast, filepath:) ⇒ FileScope
Returns a new instance of FileScope.
9 10 11 12 |
# File 'lib/i18n_flow/validator/file_scope.rb', line 9 def initialize(ast, filepath:) @ast = ast @filepath = filepath end |
Instance Attribute Details
#ast ⇒ Object (readonly)
Returns the value of attribute ast.
6 7 8 |
# File 'lib/i18n_flow/validator/file_scope.rb', line 6 def ast @ast end |
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
7 8 9 |
# File 'lib/i18n_flow/validator/file_scope.rb', line 7 def filepath @filepath end |
Instance Method Details
#errors ⇒ Object
23 24 25 |
# File 'lib/i18n_flow/validator/file_scope.rb', line 23 def errors @errors ||= [] end |
#filepath_scopes ⇒ Object
14 15 16 |
# File 'lib/i18n_flow/validator/file_scope.rb', line 14 def filepath_scopes @filepath_scopes ||= I18nFlow::Util.filepath_to_scope(filepath) end |
#validate! ⇒ Object
18 19 20 21 |
# File 'lib/i18n_flow/validator/file_scope.rb', line 18 def validate! @errors = nil validate_scope(ast, scopes: filepath_scopes) end |