Class: Coins
- Inherits:
-
Object
- Object
- Coins
- Defined in:
- lib/cardtrick/coin.rb
Instance Method Summary collapse
-
#initialize(*a) ⇒ Coins
constructor
A new instance of Coins.
- #map(&b) ⇒ Object
Constructor Details
#initialize(*a) ⇒ Coins
Returns a new instance of Coins.
27 28 29 |
# File 'lib/cardtrick/coin.rb', line 27 def initialize *a @coins = [a].flatten end |
Instance Method Details
#map(&b) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/cardtrick/coin.rb', line 30 def map &b h = {} @coins.each { |e| h[e] = Cardtrick[e].map { |ee| b.call(ee) } } return h end |