Class: OKF::TUI::Workspace::Group
- Inherits:
-
Object
- Object
- OKF::TUI::Workspace::Group
- Defined in:
- lib/okf/tui/workspace.rb
Overview
One registry group (okf 1.12): a slug naming a list of members — bundle or group slugs, so they nest — which resolves recursively, path-deduped, to bundle leaves.
members is what the registry file says, verbatim, and bundles is what
okf resolved it to. Both are shown, because they answer different questions:
the members are what an edit would change, the leaves are what a search
would cover, and for a nested group those are not the same list.
Instance Attribute Summary collapse
-
#bundles ⇒ Object
readonly
Returns the value of attribute bundles.
-
#members ⇒ Object
readonly
Returns the value of attribute members.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
Instance Method Summary collapse
-
#cyclic? ⇒ Boolean
A hand-edited registry can name a cycle, which okf reports by declining to resolve rather than by looping.
-
#initialize(slug:, members:, bundles:, cyclic:) ⇒ Group
constructor
A new instance of Group.
- #size ⇒ Object
Constructor Details
#initialize(slug:, members:, bundles:, cyclic:) ⇒ Group
Returns a new instance of Group.
57 58 59 60 61 62 |
# File 'lib/okf/tui/workspace.rb', line 57 def initialize(slug:, members:, bundles:, cyclic:) @slug = slug @members = members @bundles = bundles @cyclic = cyclic end |
Instance Attribute Details
#bundles ⇒ Object (readonly)
Returns the value of attribute bundles.
55 56 57 |
# File 'lib/okf/tui/workspace.rb', line 55 def bundles @bundles end |
#members ⇒ Object (readonly)
Returns the value of attribute members.
55 56 57 |
# File 'lib/okf/tui/workspace.rb', line 55 def members @members end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
55 56 57 |
# File 'lib/okf/tui/workspace.rb', line 55 def slug @slug end |
Instance Method Details
#cyclic? ⇒ Boolean
A hand-edited registry can name a cycle, which okf reports by declining to resolve rather than by looping. Nothing here can repair it, so the row says so and refuses to be scoped — the alternative is a group that silently covers no bundles.
68 69 70 |
# File 'lib/okf/tui/workspace.rb', line 68 def cyclic? @cyclic end |
#size ⇒ Object
72 73 74 |
# File 'lib/okf/tui/workspace.rb', line 72 def size bundles.length end |