Class: Vocab::Validator::Android
- Defined in:
- lib/vocab/validator/android.rb
Instance Method Summary collapse
- #files_to_validate ⇒ Object
-
#initialize(locales_dir = nil) ⇒ Android
constructor
A new instance of Android.
- #other_keys(path) ⇒ Object
-
#pre_validate(path) ⇒ Object
Override this method to do custom validation on the android xml string file.
- #string_keys(path = nil) ⇒ Object
Methods inherited from Base
#print, #validate, #validate_file
Constructor Details
#initialize(locales_dir = nil) ⇒ Android
Returns a new instance of Android.
5 6 7 |
# File 'lib/vocab/validator/android.rb', line 5 def initialize( locales_dir = nil ) @locales_dir = locales_dir || 'res' end |
Instance Method Details
#files_to_validate ⇒ Object
17 18 19 |
# File 'lib/vocab/validator/android.rb', line 17 def files_to_validate return Dir.glob( "#{@locales_dir}/values-*/strings.xml" ) end |
#other_keys(path) ⇒ Object
9 10 11 |
# File 'lib/vocab/validator/android.rb', line 9 def other_keys( path ) return Vocab::Translator::Android.hash_from_xml( path ).keys end |
#pre_validate(path) ⇒ Object
Override this method to do custom validation on the android xml string file
22 23 24 |
# File 'lib/vocab/validator/android.rb', line 22 def pre_validate( path ) return true end |
#string_keys(path = nil) ⇒ Object
13 14 15 |
# File 'lib/vocab/validator/android.rb', line 13 def string_keys( path = nil ) return Vocab::Translator::Android.string_keys( @locales_dir ) end |