Class: MTG::Card::Base
- Inherits:
-
Object
- Object
- MTG::Card::Base
- Includes:
- Nameable
- Defined in:
- lib/mtg/card/base.rb
Instance Attribute Summary collapse
-
#mana_cost ⇒ Object
Returns the value of attribute mana_cost.
-
#number ⇒ Object
Returns the value of attribute number.
-
#rarity ⇒ Object
Returns the value of attribute rarity.
-
#set ⇒ Object
Returns the value of attribute set.
Instance Method Summary collapse
- #converted_mana_cost ⇒ Object
-
#initialize(name, attrs = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from Nameable
Constructor Details
#initialize(name, attrs = {}) ⇒ Base
Returns a new instance of Base.
9 10 11 12 |
# File 'lib/mtg/card/base.rb', line 9 def initialize(name, attrs = {}) self.name = name attrs.each { |k, v| send("#{k}=", v) } end |
Instance Attribute Details
#mana_cost ⇒ Object
Returns the value of attribute mana_cost.
14 15 16 |
# File 'lib/mtg/card/base.rb', line 14 def mana_cost @mana_cost end |
#number ⇒ Object
Returns the value of attribute number.
14 15 16 |
# File 'lib/mtg/card/base.rb', line 14 def number @number end |
#rarity ⇒ Object
Returns the value of attribute rarity.
14 15 16 |
# File 'lib/mtg/card/base.rb', line 14 def rarity @rarity end |
#set ⇒ Object
Returns the value of attribute set.
14 15 16 |
# File 'lib/mtg/card/base.rb', line 14 def set @set end |
Instance Method Details
#converted_mana_cost ⇒ Object
16 17 18 |
# File 'lib/mtg/card/base.rb', line 16 def converted_mana_cost mana_cost.converted end |