Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 37 lines (24 sloc) 0.993 kB
b8acf67 @ymendel Adding readme
ymendel authored
1 # What?
2
3 I think this question can be best answered by a few contrived examples of what real-world use might look like.
4
5 ```
6 # This convoluted code makes sure that the @kind is "credit_card" or
7 # "purchase_order", and if it's not "credit_card", then the customer
8 # must not have a payment_method of "credit_card".
9 if [ 'credit_card', 'purchase_order' ].include?(@kind) && (@kind == 'credit_card' || current_user.customer.payment_method == 'purchase_order')
10 @order = ((@kind == 'credit_card') ? CreditCardOrder : PurchaseOrder).new(params[:order])
11
12 O_o
13 end
14 ```
15
16 or
17
18 ```
19 current_user.prelude_web_user.shipping_addresses.reject { |a| a.to_s.blank? }.sort_by(&:to_s).O_o.collect {|a| [ a.to_s, a.id ] }
20 ```
21
22 I like to think of that second usage as a judgemental `tap`.
23
9552bf3 @ymendel gem housekeeping
ymendel authored
24 Also available:
25
26 * o_O
638d7f1 @ymendel gem housekeeping
ymendel authored
27 * O.o
28 * o.O
9552bf3 @ymendel gem housekeeping
ymendel authored
29
b8acf67 @ymendel Adding readme
ymendel authored
30 ## Contributions
31
32 You want to contribute to this? Really? Y'know, you should check out my 'truthy' project, too.
33
34 ## License
35
36 nO_op uses the MIT license. Read License.txt if you care.
Something went wrong with that request. Please try again.