-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md.erb
39 lines (31 loc) · 1.32 KB
/
README.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
[![Build Status](https://travis-ci.org/idrozd/red_bikini.png?branch=master)](https://travis-ci.org/idrozd/red_bikini)
# What is this?
Something you come up with when you know a little ruby and words `public_exec` stuck in your head for a couple days:
`instance_exec` on wrapper around receiver to conceal private methods, with aliased setters
### <%= c = "cat spec/show_off_spec.rb" %>
```ruby
<%= `#{c}` %>
```
### <%= c = "cat spec/person.rb" %>
```ruby
<%= `#{c}`%>
```
### Red Bikini?
Red for ruby, bikini for informal communication
Think of objects in bikini
### Why?
It just would not let me go
### So...
You probably shouldn't use this for serious things, but I wouldn't discourage you from it of course.
Some kind of DSL sounds as a candidate topic.
I would note that inside it uses instance exec applied to a wrapper around
reciever, so it wouldn`t bind calling context methods (which is good),
but binds locals and constants.
- Also, or/equal (`||=`) won't work directly without specifiyng explicit receiver of course (`self.attr ||=` will work)
- Also, `self` wouldn't work with `case` operator - I don't want to hack reciever class `.===` just for that.
Although, you may use `_self` for this (original object).
### <%= c = "rspec --tag gotcha --format documentation" %>
<pre>
<%= `#{c}`%>
</pre>
[Detailed behavior](spec/behavior)