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.



274
275
276
277
278
279
280
281
282
283
284
# File 'lib/manasimu/card.rb', line 274

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.



272
273
274
# File 'lib/manasimu/card.rb', line 272

def color_identity
  @color_identity
end

#converted_mana_costObject

Returns the value of attribute converted_mana_cost.



272
273
274
# File 'lib/manasimu/card.rb', line 272

def converted_mana_cost
  @converted_mana_cost
end

#mana_costObject

Returns the value of attribute mana_cost.



272
273
274
# File 'lib/manasimu/card.rb', line 272

def mana_cost
  @mana_cost
end

#nameObject

Returns the value of attribute name.



272
273
274
# File 'lib/manasimu/card.rb', line 272

def name
  @name
end

#numberObject

Returns the value of attribute number.



272
273
274
# File 'lib/manasimu/card.rb', line 272

def number
  @number
end

#set_codeObject

Returns the value of attribute set_code.



272
273
274
# File 'lib/manasimu/card.rb', line 272

def set_code
  @set_code
end

#sideObject

Returns the value of attribute side.



272
273
274
# File 'lib/manasimu/card.rb', line 272

def side
  @side
end

#textObject

Returns the value of attribute text.



272
273
274
# File 'lib/manasimu/card.rb', line 272

def text
  @text
end

#typesObject

Returns the value of attribute types.



272
273
274
# File 'lib/manasimu/card.rb', line 272

def types
  @types
end

Instance Method Details

#mana_source?Boolean

Returns:

  • (Boolean)


286
287
288
# File 'lib/manasimu/card.rb', line 286

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

#to_sObject



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

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