Class: PfrpgReaders::ValidationReader
- Inherits:
-
Object
- Object
- PfrpgReaders::ValidationReader
- Defined in:
- lib/pfrpg_readers/validation_reader.rb
Instance Attribute Summary collapse
-
#feats ⇒ Object
readonly
Returns the value of attribute feats.
-
#features ⇒ Object
readonly
Returns the value of attribute features.
-
#skills ⇒ Object
readonly
Returns the value of attribute skills.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
- #feat_total ⇒ Object
- #feature_total ⇒ Object
-
#initialize(entity) ⇒ ValidationReader
constructor
A new instance of ValidationReader.
- #skill_total ⇒ Object
Constructor Details
#initialize(entity) ⇒ ValidationReader
Returns a new instance of ValidationReader.
4 5 6 7 8 9 |
# File 'lib/pfrpg_readers/validation_reader.rb', line 4 def initialize(entity) @entity = entity @feats = feat_total @skills = skill_total @features = feature_total end |
Instance Attribute Details
#feats ⇒ Object (readonly)
Returns the value of attribute feats.
3 4 5 |
# File 'lib/pfrpg_readers/validation_reader.rb', line 3 def feats @feats end |
#features ⇒ Object (readonly)
Returns the value of attribute features.
3 4 5 |
# File 'lib/pfrpg_readers/validation_reader.rb', line 3 def features @features end |
#skills ⇒ Object (readonly)
Returns the value of attribute skills.
3 4 5 |
# File 'lib/pfrpg_readers/validation_reader.rb', line 3 def skills @skills end |
Instance Method Details
#as_json(options = {}) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/pfrpg_readers/validation_reader.rb', line 23 def as_json( = {}) { :feats => @feats, :skills => @skills, :features => @features } end |
#feat_total ⇒ Object
11 12 13 |
# File 'lib/pfrpg_readers/validation_reader.rb', line 11 def feat_total return PfrpgTables::FeatTotaler.new(entity).total end |
#feature_total ⇒ Object
19 20 21 |
# File 'lib/pfrpg_readers/validation_reader.rb', line 19 def feature_total 0 end |
#skill_total ⇒ Object
15 16 17 |
# File 'lib/pfrpg_readers/validation_reader.rb', line 15 def skill_total 0 end |