Class: Briefly::Facade::Control
- Inherits:
-
Object
- Object
- Briefly::Facade::Control
- Defined in:
- lib/briefly/facade.rb
Overview
The management surface, forwarded to the facade's private +__+-prefixed methods. Mutators return
the facade so +Briefly.define+-style chaining and the return-self contract hold; readers return
their values. It forwards via send, matching the child.send(:__commit, …) pattern __commit
already uses to cross the private boundary.
Instance Method Summary collapse
-
#clear_memos! ⇒ Facade
Drops every memoized value, here and in every namespace.
-
#configure { ... } ⇒ Facade
Reopens the facade for another builder pass and recompiles.
-
#initialize(facade) ⇒ Control
constructor
A new instance of Control.
-
#inspect ⇒ String
(also: #to_s)
Names the management operations, so typing
App.brieflyat a console self-describes what the door offers instead of echoing the facade's shortcut list. - #shortcut?(name) ⇒ Boolean
-
#shortcuts ⇒ Array<Symbol>
Canonical shortcut names, sorted; aliases excluded.
Constructor Details
#initialize(facade) ⇒ Control
Returns a new instance of Control.
39 |
# File 'lib/briefly/facade.rb', line 39 def initialize(facade) = @facade = facade |
Instance Method Details
#clear_memos! ⇒ Facade
Drops every memoized value, here and in every namespace. Thread-safe.
51 |
# File 'lib/briefly/facade.rb', line 51 def clear_memos! = @facade.send(:__clear_memos!) |
#configure { ... } ⇒ Facade
Reopens the facade for another builder pass and recompiles.
57 |
# File 'lib/briefly/facade.rb', line 57 def configure(&) = @facade.send(:__configure, &) |
#inspect ⇒ String Also known as: to_s
Names the management operations, so typing App.briefly at a console self-describes what the
door offers instead of echoing the facade's shortcut list. Keep in sync with the methods above.
63 |
# File 'lib/briefly/facade.rb', line 63 def inspect = "#<#{self.class.name} shortcuts shortcut? clear_memos! configure>" |
#shortcut?(name) ⇒ Boolean
46 |
# File 'lib/briefly/facade.rb', line 46 def shortcut?(name) = @facade.send(:__shortcut?, name) |
#shortcuts ⇒ Array<Symbol>
Returns canonical shortcut names, sorted; aliases excluded.
42 |
# File 'lib/briefly/facade.rb', line 42 def shortcuts = @facade.send(:__shortcuts) |