Class: RSpec::Contracts::InterfaceGroup

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/rspec/contracts/interface_group.rb

Instance Method Summary collapse

Constructor Details

#initializeInterfaceGroup

Returns a new instance of InterfaceGroup.



8
9
10
# File 'lib/rspec/contracts/interface_group.rb', line 8

def initialize
  @collection = {}
end

Instance Method Details

#each(&block) ⇒ Object



16
17
18
# File 'lib/rspec/contracts/interface_group.rb', line 16

def each(&block)
  @collection.values.each(&block)
end

#find_or_create(name) ⇒ Object



12
13
14
# File 'lib/rspec/contracts/interface_group.rb', line 12

def find_or_create(name)
  @collection[name] ||= Interface.new(name)
end