Class: Hashira::Coupling::Census

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

Instance Method Summary collapse

Constructor Details

#initialize(project, trees, packaging: :folder) ⇒ Census

Returns a new instance of Census.



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

def initialize(project, trees, packaging: :folder)
  @project = project
  @trees = trees
  @packaging = packaging
end

Instance Method Details

#charge(file, nesting) ⇒ Object



35
# File 'lib/hashira/coupling/census.rb', line 35

def charge(file, nesting) = translate(placement.charge(file, nesting))

#foldsObject



22
# File 'lib/hashira/coupling/census.rb', line 22

def folds = folding.disclosed

#holder(segments) ⇒ Object



26
27
28
29
# File 'lib/hashira/coupling/census.rb', line 26

def holder(segments)
  path = strip(segments)
  (path.length.downto(1).map { path.first(it) }.find { type?(it) } || path).join("::")
end

#originsObject



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

def origins = roster.origins

#packagesObject



20
# File 'lib/hashira/coupling/census.rb', line 20

def packages = roster.packages | placement.baseline

#packagingObject



10
# File 'lib/hashira/coupling/census.rb', line 10

def packaging = placement.mode

#pinpoint(segments) ⇒ Object



33
# File 'lib/hashira/coupling/census.rb', line 33

def pinpoint(segments) = scope.pinpoint(segments)

#prefixObject



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

def prefix = catalog.prefix

#resolve(segments, nesting = []) ⇒ Object



31
# File 'lib/hashira/coupling/census.rb', line 31

def resolve(segments, nesting = []) = scope.resolve(segments, nesting)

#rootsObject



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

def roots = catalog.roots

#strip(segments) ⇒ Object



24
# File 'lib/hashira/coupling/census.rb', line 24

def strip(segments) = catalog.strip(segments)

#typesObject



12
# File 'lib/hashira/coupling/census.rb', line 12

def types = roster.types