Class: PfrpgCore::Demographics

Inherits:
Object
  • Object
show all
Defined in:
lib/pfrpg_core/demographics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Demographics

Returns a new instance of Demographics.



6
7
8
9
10
11
12
13
14
15
# File 'lib/pfrpg_core/demographics.rb', line 6

def initialize(params)
  @player_name    = params[:player_name]
  @character_name = params[:name]
  @deity          = params[:deity]
  @gender         = params[:gender]
  @weight         = params[:weight]
  @height         = params[:height]
  @description    = params[:description]
  @languages      = params[:languages]
end

Instance Attribute Details

#character_nameObject (readonly)

Returns the value of attribute character_name.



3
4
5
# File 'lib/pfrpg_core/demographics.rb', line 3

def character_name
  @character_name
end

#deityObject (readonly)

Returns the value of attribute deity.



3
4
5
# File 'lib/pfrpg_core/demographics.rb', line 3

def deity
  @deity
end

#descriptionObject (readonly)

Returns the value of attribute description.



3
4
5
# File 'lib/pfrpg_core/demographics.rb', line 3

def description
  @description
end

#genderObject (readonly)

Returns the value of attribute gender.



3
4
5
# File 'lib/pfrpg_core/demographics.rb', line 3

def gender
  @gender
end

#heightObject (readonly)

Returns the value of attribute height.



3
4
5
# File 'lib/pfrpg_core/demographics.rb', line 3

def height
  @height
end

#languagesObject (readonly)

Returns the value of attribute languages.



3
4
5
# File 'lib/pfrpg_core/demographics.rb', line 3

def languages
  @languages
end

#player_nameObject (readonly)

Returns the value of attribute player_name.



3
4
5
# File 'lib/pfrpg_core/demographics.rb', line 3

def player_name
  @player_name
end

#weightObject (readonly)

Returns the value of attribute weight.



3
4
5
# File 'lib/pfrpg_core/demographics.rb', line 3

def weight
  @weight
end

Instance Method Details

#as_json(options = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/pfrpg_core/demographics.rb', line 17

def as_json(options={})
  {
      :player_name    => @player_name,
      :character_name => @character_name,
      :deity          => @deity,
      :gender         => @gender,
      :height         => @height,
      :weight         => @weight,
      :description    => @description,
      :languages      => @languages
  }
end