Class: Clashinator::Army

Inherits:
Object
  • Object
show all
Defined in:
lib/clashinator/army.rb

Overview

This class represents the army model through the player model

Direct Known Subclasses

Hero, Spell, Troop

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Army

Returns a new instance of Army.



7
8
9
10
11
# File 'lib/clashinator/army.rb', line 7

def initialize(attributes)
  @name = attributes['name']
  @level = attributes['level']
  @max_level = attributes['maxLevel']
end

Instance Attribute Details

#levelObject

Returns the value of attribute level.



5
6
7
# File 'lib/clashinator/army.rb', line 5

def level
  @level
end

#max_levelObject

Returns the value of attribute max_level.



5
6
7
# File 'lib/clashinator/army.rb', line 5

def max_level
  @max_level
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/clashinator/army.rb', line 5

def name
  @name
end