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.
7 8 9 10 11 |
# File 'lib/hdeck/card.rb', line 7 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.
5 6 7 |
# File 'lib/hdeck/card.rb', line 5 def ability @ability end |
#desc ⇒ Object
Returns the value of attribute desc.
5 6 7 |
# File 'lib/hdeck/card.rb', line 5 def desc @desc end |
#morality ⇒ Object
Returns the value of attribute morality.
5 6 7 |
# File 'lib/hdeck/card.rb', line 5 def morality @morality end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/hdeck/card.rb', line 5 def name @name end |
Instance Method Details
#to_s ⇒ Object
13 14 15 |
# File 'lib/hdeck/card.rb', line 13 def to_s "(#{ability}: #{morality}) #{name}\n#{desc}" end |