Module: ActiveRecordNullObject::NullObject
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/activerecord_null_object/null_object.rb
Instance Method Summary collapse
- #blank? ⇒ Boolean
- #empty? ⇒ Boolean
- #id ⇒ Object
- #nil? ⇒ Boolean
- #present? ⇒ Boolean
- #unsavable ⇒ Object
Instance Method Details
#blank? ⇒ Boolean
23 24 25 |
# File 'lib/activerecord_null_object/null_object.rb', line 23 def blank? true end |
#empty? ⇒ Boolean
19 20 21 |
# File 'lib/activerecord_null_object/null_object.rb', line 19 def empty? true end |
#id ⇒ Object
11 12 13 |
# File 'lib/activerecord_null_object/null_object.rb', line 11 def id nil end |
#nil? ⇒ Boolean
15 16 17 |
# File 'lib/activerecord_null_object/null_object.rb', line 15 def nil? true end |
#present? ⇒ Boolean
27 28 29 |
# File 'lib/activerecord_null_object/null_object.rb', line 27 def present? false end |
#unsavable ⇒ Object
31 32 33 |
# File 'lib/activerecord_null_object/null_object.rb', line 31 def unsavable errors.add(:base, "is a null object and can't be saved") end |