Class: MTG::Card::Base

Inherits:
Object
  • Object
show all
Includes:
Nameable
Defined in:
lib/mtg/card/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Nameable

included, #name=

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_costObject

Returns the value of attribute mana_cost.



14
15
16
# File 'lib/mtg/card/base.rb', line 14

def mana_cost
  @mana_cost
end

#numberObject

Returns the value of attribute number.



14
15
16
# File 'lib/mtg/card/base.rb', line 14

def number
  @number
end

#rarityObject

Returns the value of attribute rarity.



14
15
16
# File 'lib/mtg/card/base.rb', line 14

def rarity
  @rarity
end

#setObject

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_costObject



16
17
18
# File 'lib/mtg/card/base.rb', line 16

def converted_mana_cost
  mana_cost.converted
end