Class: Content

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Content

Returns a new instance of Content.



277
278
279
280
281
282
283
284
285
286
287
# File 'lib/manasimu/card.rb', line 277

def initialize(hash)
  @name = hash[:name]
  @number = hash[:number]
  @side = hash[:side]
  @set_code = hash[:set_code]
  @mana_cost = hash[:mana_cost]
  @types = hash[:types]
  @text = hash[:text]
  @color_identity = hash[:color_identity]
  @converted_mana_cost = hash[:converted_mana_cost].to_i
end

Instance Attribute Details

#color_identityObject

Returns the value of attribute color_identity.



275
276
277
# File 'lib/manasimu/card.rb', line 275

def color_identity
  @color_identity
end

#converted_mana_costObject

Returns the value of attribute converted_mana_cost.



275
276
277
# File 'lib/manasimu/card.rb', line 275

def converted_mana_cost
  @converted_mana_cost
end

#mana_costObject

Returns the value of attribute mana_cost.



275
276
277
# File 'lib/manasimu/card.rb', line 275

def mana_cost
  @mana_cost
end

#nameObject

Returns the value of attribute name.



275
276
277
# File 'lib/manasimu/card.rb', line 275

def name
  @name
end

#numberObject

Returns the value of attribute number.



275
276
277
# File 'lib/manasimu/card.rb', line 275

def number
  @number
end

#set_codeObject

Returns the value of attribute set_code.



275
276
277
# File 'lib/manasimu/card.rb', line 275

def set_code
  @set_code
end

#sideObject

Returns the value of attribute side.



275
276
277
# File 'lib/manasimu/card.rb', line 275

def side
  @side
end

#textObject

Returns the value of attribute text.



275
276
277
# File 'lib/manasimu/card.rb', line 275

def text
  @text
end

#typesObject

Returns the value of attribute types.



275
276
277
# File 'lib/manasimu/card.rb', line 275

def types
  @types
end

Instance Method Details

#mana_source?Boolean

Returns:

  • (Boolean)


289
290
291
# File 'lib/manasimu/card.rb', line 289

def mana_source?
  return @types == "Land"
end

#to_sObject



293
294
295
# File 'lib/manasimu/card.rb', line 293

def to_s
  "[#{@name}] [#{@types}] [#{@color_identity}] [#{@mana_cost}]"
end