Class: PfrpgCore::Feat

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Feat

Returns a new instance of Feat.



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

def initialize(params)
  @name = params[:name]
  @description = params[:description]
  @effects = params[:effects] || []
  @prereqs = params[:prereqs] || []
  @special = params[:special]
  @type = params[:type]
  @source = params[:source]
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/pfrpg_core/feat.rb', line 4

def description
  @description
end

#effectsObject (readonly)

Returns the value of attribute effects.



4
5
6
# File 'lib/pfrpg_core/feat.rb', line 4

def effects
  @effects
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/pfrpg_core/feat.rb', line 4

def name
  @name
end

#prereqsObject (readonly)

Returns the value of attribute prereqs.



4
5
6
# File 'lib/pfrpg_core/feat.rb', line 4

def prereqs
  @prereqs
end

#sourceObject (readonly)

Returns the value of attribute source.



4
5
6
# File 'lib/pfrpg_core/feat.rb', line 4

def source
  @source
end

#specialObject (readonly)

Returns the value of attribute special.



4
5
6
# File 'lib/pfrpg_core/feat.rb', line 4

def special
  @special
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/pfrpg_core/feat.rb', line 4

def type
  @type
end

Instance Method Details

#as_json(options = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/pfrpg_core/feat.rb', line 17

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