Class: Mongoid::Matchers::BeStoredInMatcher
- Inherits:
-
Object
- Object
- Mongoid::Matchers::BeStoredInMatcher
- Includes:
- Helpers
- Defined in:
- lib/matchers/document/be_stored_in.rb
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(collection_name) ⇒ BeStoredInMatcher
constructor
A new instance of BeStoredInMatcher.
- #matches?(subject) ⇒ Boolean
Methods included from Helpers
Constructor Details
#initialize(collection_name) ⇒ BeStoredInMatcher
Returns a new instance of BeStoredInMatcher.
6 7 8 |
# File 'lib/matchers/document/be_stored_in.rb', line 6 def initialize(collection_name) @collection_name = collection_name.to_s end |
Instance Method Details
#description ⇒ Object
14 15 16 |
# File 'lib/matchers/document/be_stored_in.rb', line 14 def description "be stored in #{@collection_name.inspect}" end |
#matches?(subject) ⇒ Boolean
10 11 12 |
# File 'lib/matchers/document/be_stored_in.rb', line 10 def matches?(subject) class_of(subject).collection_name.to_s == @collection_name end |