> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/b/break_oo_privacy.md).

# Break OO privacy

Sidef's object model does not enforce privacy, but it allows storing private attributes inside the container of an object, which is an hash:

```ruby
class Example {
    has public = "foo"
    method init {
        self{:private} = "secret"
    }
}
 
var obj = Example();
 
# Access public attributes
say obj.public;                 #=> "foo"
say obj{:public};               #=> "foo"
 
# Access private attributes
say obj{:private};              #=> "secret"
```
