Class: Frenetic::UndefinedResourceMock
Overview
Raised when a Resource does not have a mock class defined.
For example:
class Widget < Frenetic::Resource end
class MockWidget < Widget
include Frenetic::ResourceMockery
end
Would correctly create the necessary Mock Resource
Instance Attribute Summary collapse
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(namespace, resource) ⇒ UndefinedResourceMock
constructor
A new instance of UndefinedResourceMock.
- #message ⇒ Object
Constructor Details
#initialize(namespace, resource) ⇒ UndefinedResourceMock
Returns a new instance of UndefinedResourceMock.
112 113 114 115 |
# File 'lib/frenetic/errors.rb', line 112 def initialize(namespace, resource) @namespace = namespace @resource = resource end |
Instance Attribute Details
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
111 112 113 |
# File 'lib/frenetic/errors.rb', line 111 def namespace @namespace end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
111 112 113 |
# File 'lib/frenetic/errors.rb', line 111 def resource @resource end |
Instance Method Details
#message ⇒ Object
117 118 119 120 121 |
# File 'lib/frenetic/errors.rb', line 117 def "Mock resource not defined for `#{namespace}`." \ " Create a new class that inherits from `#{resource}` and mixin" \ ' `Frenetic::ResourceMockery` to define a mock.' end |