Class: Hashira::Analysis::Folding
- Inherits:
-
Object
- Object
- Hashira::Analysis::Folding
- Defined in:
- lib/hashira/analysis/folding.rb
Constant Summary collapse
- SUFFIXES =
%w[Resource Serializer Policy Decorator].freeze
Instance Method Summary collapse
- #disclosed ⇒ Object
-
#initialize(definitions, census, suffixes: []) ⇒ Folding
constructor
A new instance of Folding.
- #map ⇒ Object
Constructor Details
#initialize(definitions, census, suffixes: []) ⇒ Folding
Returns a new instance of Folding.
8 9 10 11 12 |
# File 'lib/hashira/analysis/folding.rb', line 8 def initialize(definitions, census, suffixes: []) @definitions = definitions @census = census @suffixes = suffixes end |
Instance Method Details
#disclosed ⇒ Object
16 17 18 |
# File 'lib/hashira/analysis/folding.rb', line 16 def disclosed map.map { |from, to| { from:, to:, via: parents.key?(from) ? "base" : "suffix" } } end |
#map ⇒ Object
14 |
# File 'lib/hashira/analysis/folding.rb', line 14 def map = @map ||= links.keys.to_h { [it, settle(it, links)] }.reject { |from, to| from == to } |