Module: Unread::Reader::ClassMethods
- Defined in:
- lib/unread/reader.rb
Instance Method Summary collapse
Instance Method Details
#assert_readable(readable) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/unread/reader.rb', line 4 def assert_readable(readable) unless readable.respond_to?(:mark_as_read!) raise ArgumentError, "Class #{readable.class} is not registered by acts_as_readable." end unless readable.id raise ArgumentError, "The given #{readable.class} has no id." end end |