Class: Content
- Inherits:
-
Object
- Object
- Content
- Defined in:
- lib/manasimu/card.rb
Instance Attribute Summary collapse
-
#color_identity ⇒ Object
Returns the value of attribute color_identity.
-
#converted_mana_cost ⇒ Object
Returns the value of attribute converted_mana_cost.
-
#mana_cost ⇒ Object
Returns the value of attribute mana_cost.
-
#multiverseid ⇒ Object
Returns the value of attribute multiverseid.
-
#name ⇒ Object
Returns the value of attribute name.
-
#names ⇒ Object
Returns the value of attribute names.
-
#number ⇒ Object
Returns the value of attribute number.
-
#set_code ⇒ Object
Returns the value of attribute set_code.
-
#side ⇒ Object
Returns the value of attribute side.
-
#text ⇒ Object
Returns the value of attribute text.
-
#type ⇒ Object
Returns the value of attribute type.
-
#types ⇒ Object
Returns the value of attribute types.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Content
constructor
A new instance of Content.
- #mana_source? ⇒ Boolean
- #to_factory ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(hash) ⇒ Content
Returns a new instance of Content.
468 469 470 471 472 473 474 475 476 477 478 479 480 481 |
# File 'lib/manasimu/card.rb', line 468 def initialize(hash) @name = hash[:name] @names = hash[:names] @number = hash[:number].to_i @side = hash[:side] @set_code = hash[:set_code] @mana_cost = hash[:mana_cost] @types = hash[:types] @type = hash[:type] @text = hash[:text] @color_identity = hash[:color_identity] @converted_mana_cost = hash[:converted_mana_cost].to_i @multiverseid = hash[:multiverseid].to_i end |
Instance Attribute Details
#color_identity ⇒ Object
Returns the value of attribute color_identity.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def color_identity @color_identity end |
#converted_mana_cost ⇒ Object
Returns the value of attribute converted_mana_cost.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def converted_mana_cost @converted_mana_cost end |
#mana_cost ⇒ Object
Returns the value of attribute mana_cost.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def mana_cost @mana_cost end |
#multiverseid ⇒ Object
Returns the value of attribute multiverseid.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def multiverseid @multiverseid end |
#name ⇒ Object
Returns the value of attribute name.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def name @name end |
#names ⇒ Object
Returns the value of attribute names.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def names @names end |
#number ⇒ Object
Returns the value of attribute number.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def number @number end |
#set_code ⇒ Object
Returns the value of attribute set_code.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def set_code @set_code end |
#side ⇒ Object
Returns the value of attribute side.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def side @side end |
#text ⇒ Object
Returns the value of attribute text.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def text @text end |
#type ⇒ Object
Returns the value of attribute type.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def type @type end |
#types ⇒ Object
Returns the value of attribute types.
466 467 468 |
# File 'lib/manasimu/card.rb', line 466 def types @types end |
Instance Method Details
#mana_source? ⇒ Boolean
483 484 485 |
# File 'lib/manasimu/card.rb', line 483 def mana_source? return @types.include? "Land" end |
#to_factory ⇒ Object
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 |
# File 'lib/manasimu/card.rb', line 491 def to_factory "factory '\#{@name.underscore}_content', class: Content do\n name {'\#{@name}'}\n names {'\#{@names}'}\n number {'\#{@number}'}\n side {'\#{@side}'}\n set_code { '\#{@set_code}'}\n mana_cost { '\#{@mana_cost}'}\n type { '\#{@type}'}\n types { '\#{@types}'}\n text { '\#{@text}'}\n color_identity { '\#{@color_identity}'}\n converted_mana_cost {\#{@converted_mana_cost}}\n converted_mana_cost { \#{@multiverseid} }\nend\n" end |
#to_s ⇒ Object
487 488 489 |
# File 'lib/manasimu/card.rb', line 487 def to_s "[#{@name}] [#{@names}] [#{@types}] [#{@color_identity}] [#{@mana_cost}]" end |