Module: Stratagem::ApplicationExtensions::Models::Mocking

Included in:
InstanceAnnotations
Defined in:
lib/stratagem/framework_extensions/models/mocking.rb

Instance Method Summary collapse

Instance Method Details

#mock_attributesObject



3
4
5
# File 'lib/stratagem/framework_extensions/models/mocking.rb', line 3

def mock_attributes
  @attributes ||= {}
end

#read_mock_attribute(name) ⇒ Object



11
12
13
# File 'lib/stratagem/framework_extensions/models/mocking.rb', line 11

def read_mock_attribute(name)
  mock_attributes[name]
end

#used_in_mock_relationObject



15
16
17
# File 'lib/stratagem/framework_extensions/models/mocking.rb', line 15

def used_in_mock_relation
  @available_for_mock_relation = false
end

#used_in_mock_relation?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/stratagem/framework_extensions/models/mocking.rb', line 19

def used_in_mock_relation?
  @available_for_mock_relation ||= true
end

#write_mock_attribute(name, value) ⇒ Object



7
8
9
# File 'lib/stratagem/framework_extensions/models/mocking.rb', line 7

def write_mock_attribute(name, value)
  mock_attributes[name] = value
end