Class: MockRecord::Base
- Inherits:
-
Object
- Object
- MockRecord::Base
- Defined in:
- lib/mock_record/base.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #_read_attribute(attribute) ⇒ Object
- #destroyed? ⇒ Boolean
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #marked_for_destruction? ⇒ Boolean
- #new_record? ⇒ Boolean
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
4 5 6 |
# File 'lib/mock_record/base.rb', line 4 def initialize @id = 0 end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/mock_record/base.rb', line 3 def id @id end |
Class Method Details
.base_class ⇒ Object
10 11 12 |
# File 'lib/mock_record/base.rb', line 10 def self.base_class self end |
.name ⇒ Object
13 14 15 |
# File 'lib/mock_record/base.rb', line 13 def self.name self.to_s end |
.primary_key ⇒ Object
7 8 9 |
# File 'lib/mock_record/base.rb', line 7 def self.primary_key 0 end |
Instance Method Details
#_read_attribute(attribute) ⇒ Object
16 17 18 |
# File 'lib/mock_record/base.rb', line 16 def _read_attribute attribute nil end |
#destroyed? ⇒ Boolean
22 23 24 |
# File 'lib/mock_record/base.rb', line 22 def destroyed? false end |
#marked_for_destruction? ⇒ Boolean
19 20 21 |
# File 'lib/mock_record/base.rb', line 19 def marked_for_destruction? false end |
#new_record? ⇒ Boolean
25 26 27 |
# File 'lib/mock_record/base.rb', line 25 def new_record? false end |