Class: GameEngine::Card
- Inherits:
-
Object
- Object
- GameEngine::Card
- Defined in:
- lib/smack_engine/card.rb
Instance Attribute Summary collapse
-
#card_type ⇒ Object
readonly
Returns the value of attribute card_type.
-
#charisma ⇒ Object
readonly
Returns the value of attribute charisma.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#intelligence ⇒ Object
readonly
Returns the value of attribute intelligence.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#strength ⇒ Object
readonly
Returns the value of attribute strength.
-
#time_period ⇒ Object
readonly
Returns the value of attribute time_period.
Instance Method Summary collapse
-
#initialize(card_data) ⇒ Card
constructor
A new instance of Card.
- #max_stat ⇒ Object
Constructor Details
#initialize(card_data) ⇒ Card
Returns a new instance of Card.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/smack_engine/card.rb', line 5 def initialize(card_data) @id = card_data.id @type = card_data.card_type @name = card_data.name @description = card_data.description @strength = card_data.strength @intelligence = card_data.intelligence @charisma = card_data.charisma @time_period = card_data.time_period @picture_url = card_data.picture_url end |
Instance Attribute Details
#card_type ⇒ Object (readonly)
Returns the value of attribute card_type.
3 4 5 |
# File 'lib/smack_engine/card.rb', line 3 def card_type @card_type end |
#charisma ⇒ Object (readonly)
Returns the value of attribute charisma.
3 4 5 |
# File 'lib/smack_engine/card.rb', line 3 def charisma @charisma end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/smack_engine/card.rb', line 3 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/smack_engine/card.rb', line 3 def id @id end |
#intelligence ⇒ Object (readonly)
Returns the value of attribute intelligence.
3 4 5 |
# File 'lib/smack_engine/card.rb', line 3 def intelligence @intelligence end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/smack_engine/card.rb', line 3 def name @name end |
#strength ⇒ Object (readonly)
Returns the value of attribute strength.
3 4 5 |
# File 'lib/smack_engine/card.rb', line 3 def strength @strength end |
#time_period ⇒ Object (readonly)
Returns the value of attribute time_period.
3 4 5 |
# File 'lib/smack_engine/card.rb', line 3 def time_period @time_period end |
Instance Method Details
#max_stat ⇒ Object
17 18 19 |
# File 'lib/smack_engine/card.rb', line 17 def max_stat [strength,intelligence,charisma].max end |