Module: EventMachine::Kannel::Validations
- Included in:
- Configuration, Message
- Defined in:
- lib/em-kannel/validations.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 7 8 |
# File 'lib/em-kannel/validations.rb', line 4 def self.included(base) base.class_eval do include ActiveModel::Validations end end |
Instance Method Details
#friendly_name ⇒ Object
19 20 21 |
# File 'lib/em-kannel/validations.rb', line 19 def friendly_name self.class.model_name.human end |
#validate! ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/em-kannel/validations.rb', line 10 def validate! if invalid? = "Invalid #{friendly_name}: #{}" raise ArgumentError.new() end true end |