Class: Briefly::Facade::Control

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(facade) ⇒ Control

Returns a new instance of Control.

Parameters:



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.

Returns:



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.

Yields:

Returns:



57
# File 'lib/briefly/facade.rb', line 57

def configure(&) = @facade.send(:__configure, &)

#inspectString 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.

Returns:

  • (String)


63
# File 'lib/briefly/facade.rb', line 63

def inspect = "#<#{self.class.name} shortcuts shortcut? clear_memos! configure>"

#shortcut?(name) ⇒ Boolean

Parameters:

  • name (Symbol)

    a canonical name or an alias

Returns:

  • (Boolean)


46
# File 'lib/briefly/facade.rb', line 46

def shortcut?(name) = @facade.send(:__shortcut?, name)

#shortcutsArray<Symbol>

Returns canonical shortcut names, sorted; aliases excluded.

Returns:

  • (Array<Symbol>)

    canonical shortcut names, sorted; aliases excluded



42
# File 'lib/briefly/facade.rb', line 42

def shortcuts = @facade.send(:__shortcuts)