There are 1512 cards with this tag.
There are 4 decks with cards that have this tag.
how to write a dsl which shoots out a message if code in a block is true
dsl:
event "we're earning money" {recent_order > 1000 }
def event(name)
puts name if yield
end
Dir.glob('*events.rb').each {|file| load_file}
- View
- 1 like
a = [1, 2, 3]
a.permutation(2).to_a
two element arrays
[[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
- View
- 0 likes
How do make a regular expression match beginning and end of a string
\A - for beginning
\z - for end of string
- View
- 0 likes
how to assign an exception object (ArgumentError) to the variable exp
rescue ArgumentError => exp
- View
- 0 likes
in ruby 1.9, what is a concise syntax for named arguments
login(name: 'bill', code: 45)
# actually this is the concise syntax for hashes with symbol keys
- View
- 0 likes
what is a class variable (as opposed to a class instance variable)
class C
@@v = 1
end
this is a class variable (@v = instance var)
- View
- 0 likes
-
- Previous
- Page 1 of 126
- Next
- There are 1512 results.