Class: Hashira::Coupling::Roster

Inherits:
Object
  • Object
show all
Defined in:
lib/hashira/coupling/roster.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(placed) ⇒ Roster

Returns a new instance of Roster.



4
5
6
7
8
9
10
# File 'lib/hashira/coupling/roster.rb', line 4

def initialize(placed)
  @registry = Hashira::Coupling::ConstantRegistry.new
  @types = Hash.new(0)
  @typed = Set.new
  counted = Set.new
  placed.each { |definition, package| admit(definition, package, counted) }
end

Instance Attribute Details

#registryObject (readonly)

Returns the value of attribute registry.



12
13
14
# File 'lib/hashira/coupling/roster.rb', line 12

def registry
  @registry
end

#typesObject (readonly)

Returns the value of attribute types.



12
13
14
# File 'lib/hashira/coupling/roster.rb', line 12

def types
  @types
end

Instance Method Details

#originsObject



14
# File 'lib/hashira/coupling/roster.rb', line 14

def origins = @registry.origins

#packagesObject



18
# File 'lib/hashira/coupling/roster.rb', line 18

def packages = @types.keys | @registry.packages

#type?(path) ⇒ Boolean

Returns:

  • (Boolean)


16
# File 'lib/hashira/coupling/roster.rb', line 16

def type?(path) = @typed.include?(path)