Class: Coins

Inherits:
Object
  • Object
show all
Defined in:
lib/cardtrick/coin.rb

Instance Method Summary collapse

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