Class: MockRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/mock_record/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

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

#idObject

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_classObject



10
11
12
# File 'lib/mock_record/base.rb', line 10

def self.base_class
	self
end

.nameObject



13
14
15
# File 'lib/mock_record/base.rb', line 13

def self.name
	self.to_s
end

.primary_keyObject



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

Returns:

  • (Boolean)


22
23
24
# File 'lib/mock_record/base.rb', line 22

def destroyed?
	false
end

#marked_for_destruction?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/mock_record/base.rb', line 19

def marked_for_destruction?
	false
end

#new_record?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/mock_record/base.rb', line 25

def new_record?
	false
end