Class: PfrpgCore::Feat
- Inherits:
-
Object
- Object
- PfrpgCore::Feat
- Includes:
- PfrpgUtility::Affectable
- Defined in:
- lib/pfrpg_core/feat.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#effects ⇒ Object
readonly
Returns the value of attribute effects.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#prereqs ⇒ Object
readonly
Returns the value of attribute prereqs.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#special ⇒ Object
readonly
Returns the value of attribute special.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(params) ⇒ Feat
constructor
A new instance of Feat.
Constructor Details
#initialize(params) ⇒ Feat
7 8 9 10 11 12 13 14 15 |
# File 'lib/pfrpg_core/feat.rb', line 7 def initialize(params) @name = params[:name] @description = params[:description] @effects = params[:effects] || [] @prereqs = params[:prereqs] || [] @special = params[:special] @type = params[:type] @source = params[:source] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/pfrpg_core/feat.rb', line 4 def description @description end |
#effects ⇒ Object (readonly)
Returns the value of attribute effects.
4 5 6 |
# File 'lib/pfrpg_core/feat.rb', line 4 def effects @effects end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/pfrpg_core/feat.rb', line 4 def name @name end |
#prereqs ⇒ Object (readonly)
Returns the value of attribute prereqs.
4 5 6 |
# File 'lib/pfrpg_core/feat.rb', line 4 def prereqs @prereqs end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
4 5 6 |
# File 'lib/pfrpg_core/feat.rb', line 4 def source @source end |
#special ⇒ Object (readonly)
Returns the value of attribute special.
4 5 6 |
# File 'lib/pfrpg_core/feat.rb', line 4 def special @special end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/pfrpg_core/feat.rb', line 4 def type @type end |
Instance Method Details
#as_json(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/pfrpg_core/feat.rb', line 17 def as_json(={}) { name: @name, description: @description, special: @special, type: @type, source: @source } end |