Class: Tundengine::Ranks::Base
- Inherits:
-
Object
- Object
- Tundengine::Ranks::Base
- Includes:
- Comparable, Singleton, StringifiableByClass
- Defined in:
- lib/tundengine/ranks/base.rb
Instance Attribute Summary collapse
-
#power ⇒ Object
readonly
Returns the value of attribute power.
-
#round_points ⇒ Object
readonly
Returns the value of attribute round_points.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other_rank) ⇒ Object
- #de(suit) ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
Methods included from StringifiableByClass
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
24 25 26 27 |
# File 'lib/tundengine/ranks/base.rb', line 24 def initialize @round_points = self.class::ROUND_POINTS @power = self.class::POWER end |
Instance Attribute Details
#power ⇒ Object (readonly)
Returns the value of attribute power.
9 10 11 |
# File 'lib/tundengine/ranks/base.rb', line 9 def power @power end |
#round_points ⇒ Object (readonly)
Returns the value of attribute round_points.
9 10 11 |
# File 'lib/tundengine/ranks/base.rb', line 9 def round_points @round_points end |
Class Method Details
.de(suit) ⇒ Object
11 12 13 |
# File 'lib/tundengine/ranks/base.rb', line 11 def self.de(suit) instance.de(suit) end |
Instance Method Details
#<=>(other_rank) ⇒ Object
20 21 22 |
# File 'lib/tundengine/ranks/base.rb', line 20 def <=>(other_rank) @power <=> other_rank.power end |