Class: PfrpgReaders::AttributesReader
- Inherits:
-
Object
- Object
- PfrpgReaders::AttributesReader
- Defined in:
- lib/pfrpg_readers/attributes_reader.rb
Instance Attribute Summary collapse
-
#character ⇒ Object
readonly
Returns the value of attribute character.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
- #charisma ⇒ Object
- #charisma_modifier ⇒ Object
- #constitution ⇒ Object
- #constitution_modifier ⇒ Object
- #dexterity ⇒ Object
- #dexterity_modifier ⇒ Object
-
#initialize(character) ⇒ AttributesReader
constructor
A new instance of AttributesReader.
- #intelligence ⇒ Object
- #intelligence_modifier ⇒ Object
- #strength ⇒ Object
- #strength_modifier ⇒ Object
- #wisdom ⇒ Object
- #wisdom_modifier ⇒ Object
Constructor Details
#initialize(character) ⇒ AttributesReader
Returns a new instance of AttributesReader.
4 5 6 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 4 def initialize(character) @character = character end |
Instance Attribute Details
#character ⇒ Object (readonly)
Returns the value of attribute character.
2 3 4 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 2 def character @character end |
Instance Method Details
#as_json(options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 8 def as_json(={}) { :values => { :strength => strength, :dexterity => dexterity, :charisma => charisma, :wisdom => wisdom, :constitution => constitution, :intelligence => intelligence }, :modifier => { :strength => strength_modifier, :dexterity => dexterity_modifier, :charisma => charisma_modifier, :wisdom => wisdom_modifier, :constitution => constitution_modifier, :intelligence => intelligence_modifier } } end |
#charisma ⇒ Object
45 46 47 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 45 def charisma @character.modified_cha end |
#charisma_modifier ⇒ Object
49 50 51 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 49 def charisma_modifier @character.cha_mod end |
#constitution ⇒ Object
69 70 71 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 69 def constitution @character.modified_con end |
#constitution_modifier ⇒ Object
73 74 75 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 73 def constitution_modifier @character.con_mod end |
#dexterity ⇒ Object
37 38 39 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 37 def dexterity @character.modified_dex end |
#dexterity_modifier ⇒ Object
41 42 43 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 41 def dexterity_modifier @character.dex_mod end |
#intelligence ⇒ Object
53 54 55 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 53 def intelligence @character.modified_int end |
#intelligence_modifier ⇒ Object
57 58 59 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 57 def intelligence_modifier @character.int_mod end |
#strength ⇒ Object
29 30 31 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 29 def strength @character.modified_str end |
#strength_modifier ⇒ Object
33 34 35 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 33 def strength_modifier @character.str_mod end |
#wisdom ⇒ Object
61 62 63 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 61 def wisdom @character.modified_wis end |
#wisdom_modifier ⇒ Object
65 66 67 |
# File 'lib/pfrpg_readers/attributes_reader.rb', line 65 def wisdom_modifier @character.wis_mod end |