Class: Spec::Expectations::Helper::CollectionWithLengthMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/gems/rspec-1.1.11/spec/spec/spec_classes.rb

Instance Method Summary collapse

Constructor Details

#initializeCollectionWithLengthMethod

Returns a new instance of CollectionWithLengthMethod.



28
# File 'lib/gems/rspec-1.1.11/spec/spec/spec_classes.rb', line 28

def initialize; @list = []; end

Instance Method Details

#lengthObject



29
# File 'lib/gems/rspec-1.1.11/spec/spec/spec_classes.rb', line 29

def length; @list.size; end

#push(item) ⇒ Object



30
# File 'lib/gems/rspec-1.1.11/spec/spec/spec_classes.rb', line 30

def push(item); @list.push(item); end