Class: HDeck::Card
- Inherits:
-
Object
- Object
- HDeck::Card
- Defined in:
- lib/hdeck/card.rb
Overview
An individual Harrow card unit, described on this page: pathfinder.fandom.com/wiki/List_of_harrow_cards
Instance Attribute Summary collapse
-
#ability ⇒ Object
Returns the value of attribute ability.
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#morality ⇒ Object
Returns the value of attribute morality.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(args) ⇒ Card
constructor
A new instance of Card.
- #to_s ⇒ Object
Constructor Details
#initialize(args) ⇒ Card
Returns a new instance of Card.
9 10 11 12 13 |
# File 'lib/hdeck/card.rb', line 9 def initialize(args) args.each do |k, v| instance_variable_set("@#{k}", v) unless v.nil? end end |
Instance Attribute Details
#ability ⇒ Object
Returns the value of attribute ability.
7 8 9 |
# File 'lib/hdeck/card.rb', line 7 def ability @ability end |
#desc ⇒ Object
Returns the value of attribute desc.
7 8 9 |
# File 'lib/hdeck/card.rb', line 7 def desc @desc end |
#morality ⇒ Object
Returns the value of attribute morality.
7 8 9 |
# File 'lib/hdeck/card.rb', line 7 def morality @morality end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/hdeck/card.rb', line 7 def name @name end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/hdeck/card.rb', line 15 def to_s "(#{ability}: #{morality}) #{name}\n#{desc}" end |