Created
April 3, 2012 21:10
-
-
Save Brahyt/2295523 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NewCard | |
def initialize(name, life, damage) | |
@cardname = name | |
@life = life | |
@damage = damage | |
end | |
def card | |
cardname = @cardname #<= This value | |
life = @life | |
damage = @damage | |
end | |
end | |
attack_card_a = NewCard.new("attack card", 3, 2) | |
attack_card_b = NewCard.new("atack card of justice", 5, 1) | |
puts attack_card_a.card.cardname #Is it possible to call the varible cardname and puts it from here? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment