Class: CardTypeAggregate

Inherits:
Object
  • Object
show all
Defined in:
lib/manasimu/card.rb

Instance Method Summary collapse

Instance Method Details

#add(card_type) ⇒ Object



403
404
405
406
# File 'lib/manasimu/card.rb', line 403

def add(card_type)
  @memo ||= []
  @memo << card_type
end

#eachObject



408
409
410
411
412
413
# File 'lib/manasimu/card.rb', line 408

def each
  return if not @memo
  @memo.each do |item|
    yield item
  end
end

#find(set_code, number) ⇒ Object



395
396
397
398
399
400
401
# File 'lib/manasimu/card.rb', line 395

def find(set_code, number)
  @memo ||= []
  @memo.find do |c|
    a = c.contents[0]
    a and a.set_code == set_code and a.number == number
  end
end

#mapObject



415
416
417
418
419
# File 'lib/manasimu/card.rb', line 415

def map
  @memo.map do |item|
    yield item
  end
end