Class: Spec::Expectations::Helper::CollectionOwner
- Defined in:
- lib/vendor/plugins/rspec/spec/support/spec_classes.rb
Instance Attribute Summary collapse
-
#items_in_collection_with_length_method ⇒ Object
readonly
Returns the value of attribute items_in_collection_with_length_method.
-
#items_in_collection_with_size_method ⇒ Object
readonly
Returns the value of attribute items_in_collection_with_size_method.
Instance Method Summary collapse
- #add_to_collection_with_length_method(item) ⇒ Object
- #add_to_collection_with_size_method(item) ⇒ Object
-
#initialize ⇒ CollectionOwner
constructor
A new instance of CollectionOwner.
- #items ⇒ Object
- #items_for(arg) ⇒ Object
Constructor Details
#initialize ⇒ CollectionOwner
Returns a new instance of CollectionOwner.
36 37 38 39 |
# File 'lib/vendor/plugins/rspec/spec/support/spec_classes.rb', line 36 def initialize @items_in_collection_with_size_method = CollectionWithSizeMethod.new @items_in_collection_with_length_method = CollectionWithLengthMethod.new end |
Instance Attribute Details
#items_in_collection_with_length_method ⇒ Object (readonly)
Returns the value of attribute items_in_collection_with_length_method.
34 35 36 |
# File 'lib/vendor/plugins/rspec/spec/support/spec_classes.rb', line 34 def items_in_collection_with_length_method @items_in_collection_with_length_method end |
#items_in_collection_with_size_method ⇒ Object (readonly)
Returns the value of attribute items_in_collection_with_size_method.
34 35 36 |
# File 'lib/vendor/plugins/rspec/spec/support/spec_classes.rb', line 34 def items_in_collection_with_size_method @items_in_collection_with_size_method end |
Instance Method Details
#add_to_collection_with_length_method(item) ⇒ Object
45 46 47 |
# File 'lib/vendor/plugins/rspec/spec/support/spec_classes.rb', line 45 def add_to_collection_with_length_method(item) @items_in_collection_with_length_method.push(item) end |
#add_to_collection_with_size_method(item) ⇒ Object
41 42 43 |
# File 'lib/vendor/plugins/rspec/spec/support/spec_classes.rb', line 41 def add_to_collection_with_size_method(item) @items_in_collection_with_size_method.push(item) end |
#items ⇒ Object
54 55 56 |
# File 'lib/vendor/plugins/rspec/spec/support/spec_classes.rb', line 54 def items @items_in_collection_with_size_method end |
#items_for(arg) ⇒ Object
49 50 51 52 |
# File 'lib/vendor/plugins/rspec/spec/support/spec_classes.rb', line 49 def items_for(arg) return [1, 2, 3] if arg == 'a' [1] end |