Class: Dmcli::Spell
- Inherits:
-
Object
- Object
- Dmcli::Spell
- Defined in:
- lib/dmcli/spell.rb
Overview
Spell Defines a spell object for storing Dungeons and Dragons spells
Instance Attribute Summary collapse
-
#description_text ⇒ Object
readonly
Returns the value of attribute description_text.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#effect ⇒ Object
readonly
Returns the value of attribute effect.
-
#is_reversible ⇒ Object
readonly
Returns the value of attribute is_reversible.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#range ⇒ Object
readonly
Returns the value of attribute range.
-
#spell_class ⇒ Object
readonly
Returns the value of attribute spell_class.
-
#spell_level ⇒ Object
readonly
Returns the value of attribute spell_level.
Instance Method Summary collapse
-
#initialize(name, is_reversible, spell_class, spell_level, range, duration, effect, description_text) ⇒ Spell
constructor
A new instance of Spell.
- #to_s ⇒ Object
Constructor Details
#initialize(name, is_reversible, spell_class, spell_level, range, duration, effect, description_text) ⇒ Spell
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/dmcli/spell.rb', line 9 def initialize( name, is_reversible, spell_class, spell_level, range, duration, effect, description_text ) @name = name @is_reversible = is_reversible @spell_class = spell_class @spell_level = spell_level @range = range @duration = duration @effect = effect @description_text = description_text end |
Instance Attribute Details
#description_text ⇒ Object (readonly)
Returns the value of attribute description_text.
7 8 9 |
# File 'lib/dmcli/spell.rb', line 7 def description_text @description_text end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
7 8 9 |
# File 'lib/dmcli/spell.rb', line 7 def duration @duration end |
#effect ⇒ Object (readonly)
Returns the value of attribute effect.
7 8 9 |
# File 'lib/dmcli/spell.rb', line 7 def effect @effect end |
#is_reversible ⇒ Object (readonly)
Returns the value of attribute is_reversible.
7 8 9 |
# File 'lib/dmcli/spell.rb', line 7 def is_reversible @is_reversible end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/dmcli/spell.rb', line 7 def name @name end |
#range ⇒ Object (readonly)
Returns the value of attribute range.
7 8 9 |
# File 'lib/dmcli/spell.rb', line 7 def range @range end |
#spell_class ⇒ Object (readonly)
Returns the value of attribute spell_class.
7 8 9 |
# File 'lib/dmcli/spell.rb', line 7 def spell_class @spell_class end |
#spell_level ⇒ Object (readonly)
Returns the value of attribute spell_level.
7 8 9 |
# File 'lib/dmcli/spell.rb', line 7 def spell_level @spell_level end |
Instance Method Details
#to_s ⇒ Object
29 30 31 |
# File 'lib/dmcli/spell.rb', line 29 def to_s "#{@name.ljust(35)} #{@spell_class.ljust(13).capitalize} #{@spell_level.ljust(4)} #{@range.ljust(30)} #{@duration.ljust(45)} #{@effect}" end |