Class: PfrpgRaces::RacialTrait
- Inherits:
-
Object
- Object
- PfrpgRaces::RacialTrait
- Defined in:
- lib/pfrpg_races/racial_trait.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#effects ⇒ Object
Returns the value of attribute effects.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
- #get_effects ⇒ Object
-
#initialize(args) ⇒ RacialTrait
constructor
A new instance of RacialTrait.
Constructor Details
#initialize(args) ⇒ RacialTrait
Returns a new instance of RacialTrait.
5 6 7 8 9 10 |
# File 'lib/pfrpg_races/racial_trait.rb', line 5 def initialize(args) @name = args[:name] @description = args[:description] @effects = args[:effects] @effects ||= [] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/pfrpg_races/racial_trait.rb', line 4 def description @description end |
#effects ⇒ Object
Returns the value of attribute effects.
4 5 6 |
# File 'lib/pfrpg_races/racial_trait.rb', line 4 def effects @effects end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/pfrpg_races/racial_trait.rb', line 4 def name @name end |
Instance Method Details
#as_json(options = {}) ⇒ Object
16 17 18 19 20 |
# File 'lib/pfrpg_races/racial_trait.rb', line 16 def as_json(={}) { :name => name, :description => description } end |
#get_effects ⇒ Object
12 13 14 |
# File 'lib/pfrpg_races/racial_trait.rb', line 12 def get_effects effects end |