Class: Hashira::Coupling::Roster
- Inherits:
-
Object
- Object
- Hashira::Coupling::Roster
- Defined in:
- lib/hashira/coupling/roster.rb
Instance Attribute Summary collapse
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
-
#initialize(placed) ⇒ Roster
constructor
A new instance of Roster.
- #origins ⇒ Object
- #packages ⇒ Object
- #type?(path) ⇒ Boolean
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
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
12 13 14 |
# File 'lib/hashira/coupling/roster.rb', line 12 def registry @registry end |
#types ⇒ Object (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
#origins ⇒ Object
14 |
# File 'lib/hashira/coupling/roster.rb', line 14 def origins = @registry.origins |
#packages ⇒ Object
18 |
# File 'lib/hashira/coupling/roster.rb', line 18 def packages = @types.keys | @registry.packages |
#type?(path) ⇒ Boolean
16 |
# File 'lib/hashira/coupling/roster.rb', line 16 def type?(path) = @typed.include?(path) |