Module: Gratan::DSL::Validator
- Included in:
- Context, Context::On, Context::User
- Defined in:
- lib/gratan/dsl/validator.rb
Instance Method Summary collapse
Instance Method Details
#__identify(errmsg) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/gratan/dsl/validator.rb', line 6 def __identify(errmsg) if @object_identifier errmsg = "#{@object_identifier}: #{errmsg}" end return errmsg end |
#__validate(errmsg) ⇒ Object
2 3 4 |
# File 'lib/gratan/dsl/validator.rb', line 2 def __validate(errmsg) raise __identify(errmsg) unless yield end |