class Card

Attributes

card_type[RW]
color[RW]
combat_stats[RW]
cost[RW]
flavor_text[RW]
name[RW]
price[RW]
purchase_url[RW]
rarity[RW]
rules_text[RW]
sets[RW]
url[RW]

Public Class Methods

all() click to toggle source
# File lib/magic_tcg_finder/card.rb, line 12
def self.all
  @@all
end
create_from_collection(card_arr) click to toggle source
# File lib/magic_tcg_finder/card.rb, line 20
def self.create_from_collection(card_arr)
  card_arr.each do |card|
    new_card = Card.new(card)
  end
end
destroy_all() click to toggle source
# File lib/magic_tcg_finder/card.rb, line 16
def self.destroy_all
  self.all.clear
end
new(attributes) click to toggle source
# File lib/magic_tcg_finder/card.rb, line 7
def initialize(attributes)
  attributes.each {|attribute, value| self.send(("#{attribute}="), value)}
  @@all << self
end

Public Instance Methods

add_card_attributes(attribute_hash) click to toggle source
# File lib/magic_tcg_finder/card.rb, line 26
def add_card_attributes(attribute_hash)
  attribute_hash.each {|attribute, value| self.send(("#{attribute}="), value)}
end