Class: PfrpgCore::ClassFeature

Inherits:
Object
  • Object
show all
Includes:
PfrpgUtility::Affectable
Defined in:
lib/pfrpg_core/class_feature.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ ClassFeature

Returns a new instance of ClassFeature.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/pfrpg_core/class_feature.rb', line 9

def initialize(params)
  @name         = params[:name]
  @description  = params[:description]
  @effects      = params[:effects]
  @type         = params[:type]
  @category     = params[:category]
  @special      = params[:special]
  @attack_filter= params[:attack_filter]
  @armor_filter = params[:armor_filter]
  @ability_name = params[:ability_name]
end

Instance Attribute Details

#ability_nameObject (readonly)

Returns the value of attribute ability_name.



5
6
7
# File 'lib/pfrpg_core/class_feature.rb', line 5

def ability_name
  @ability_name
end

#armor_filterObject (readonly)

Returns the value of attribute armor_filter.



5
6
7
# File 'lib/pfrpg_core/class_feature.rb', line 5

def armor_filter
  @armor_filter
end

#attack_filterObject (readonly)

Returns the value of attribute attack_filter.



5
6
7
# File 'lib/pfrpg_core/class_feature.rb', line 5

def attack_filter
  @attack_filter
end

#categoryObject (readonly)

Returns the value of attribute category.



5
6
7
# File 'lib/pfrpg_core/class_feature.rb', line 5

def category
  @category
end

#descriptionObject (readonly)

Returns the value of attribute description.



5
6
7
# File 'lib/pfrpg_core/class_feature.rb', line 5

def description
  @description
end

#effectsObject (readonly)

Returns the value of attribute effects.



5
6
7
# File 'lib/pfrpg_core/class_feature.rb', line 5

def effects
  @effects
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/pfrpg_core/class_feature.rb', line 5

def name
  @name
end

#specialObject (readonly)

Returns the value of attribute special.



5
6
7
# File 'lib/pfrpg_core/class_feature.rb', line 5

def special
  @special
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/pfrpg_core/class_feature.rb', line 5

def type
  @type
end

Instance Method Details

#as_json(options = {}) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/pfrpg_core/class_feature.rb', line 21

def as_json(options={})
  {
      name: @name,
      description: @description,
      type: @type,
      category: @category,
      name: @name
  }
end