txt: ## privatemethodcontainer.md
  role Metamodel::PrivateMethodContainer
  
  Metaobject that supports private methods
  
  ```raku
  role Metamodel::PrivateMethodContainer { ... }
  ```
  
  *Warning*: this role is part of the Rakudo implementation, and is not a part of the Raku language specification.
  
  In Raku, classes, roles and grammars can have private methods, that is, methods that are only callable from within it, and are not inherited by types derived by inheritance.
  
  ```raku
  class A {
      # the ! declares a private method
      method !double($x) {
          say 2 * $x;
      }
      method call-double($y) {
          # call with ! instead of .
          self!double($y);
      }
  }
  ```
  
  For the purposes of dispatching and scoping, private methods are closer to subroutines than to methods. However they share access to `self` and attributes with methods.
  
  # [Methods](#role_Metamodel::PrivateMethodContainer "go to top of document")[§](#Methods "direct link")
  
  ## [method add\_private\_method](#role_Metamodel::PrivateMethodContainer "go to top of document")[§](#method_add_private_method "direct link")
  
  ```raku
  method add_private_method($obj, $name, $code)
  
  ```
  
  Adds a private method `$code` with name `$name`.
  
  ## [method private\_method\_table](#role_Metamodel::PrivateMethodContainer "go to top of document")[§](#method_private_method_table "direct link")
  
  ```raku
  method private_method_table($obj)
  
  ```
  
  Returns a hash of `name => &method_object`
  
  ## [method private\_methods](#role_Metamodel::PrivateMethodContainer "go to top of document")[§](#method_private_methods "direct link")
  
  ```raku
  method private_methods($obj)
  
  ```
  
  Returns a list of private method names.
  
  ## [method private\_method\_names](#role_Metamodel::PrivateMethodContainer "go to top of document")[§](#method_private_method_names "direct link")
  
  ```raku
  method private_method_names($obj)
  
  ```
  
  Alias to `private_methods`.
  
  ## [method find\_private\_method](#role_Metamodel::PrivateMethodContainer "go to top of document")[§](#method_find_private_method "direct link")
  
  ```raku
  method find_private_method($obj, $name)
  
  ```
  
  Locates a private method. Otherwise, returns [`Mu`](/type/Mu) if it doesn't exist.
  