Class: Belafonte::Validator
- Inherits:
-
Object
- Object
- Belafonte::Validator
- Defined in:
- lib/belafonte/validator.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #app_title ⇒ Object
-
#initialize(app) ⇒ Validator
constructor
A new instance of Validator.
- #valid? ⇒ Boolean
Constructor Details
#initialize(app) ⇒ Validator
Returns a new instance of Validator.
5 6 7 8 |
# File 'lib/belafonte/validator.rb', line 5 def initialize(app) @app = app @errors = {} end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/belafonte/validator.rb', line 3 def errors @errors end |
Instance Method Details
#app_title ⇒ Object
18 19 20 |
# File 'lib/belafonte/validator.rb', line 18 def app_title app.info(:title) end |
#valid? ⇒ Boolean
10 11 12 13 14 15 16 |
# File 'lib/belafonte/validator.rb', line 10 def valid? error_if_app_lacks_title error_if_app_has_multiple_unlimited_args error_if_app_has_mounts_and_unlimited_args errors.empty? end |