Class: Smite::God

Inherits:
Object show all
Defined in:
lib/smite/god.rb

Instance Attribute Summary

Attributes inherited from Object

#data

Instance Method Summary collapse

Methods inherited from Object

#attributes, #method_missing

Constructor Details

#initialize(data) ⇒ God

Returns a new instance of God.



3
4
5
6
7
# File 'lib/smite/god.rb', line 3

def initialize(data)
  super
  @data = DataTransform.transform_abilities(@data)
  @data = DataTransform.transform_stats(@data)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Smite::Object

Instance Method Details

#inspectObject



29
30
31
# File 'lib/smite/god.rb', line 29

def inspect
  "#<Smite::God #{id} '#{name}'>"
end

#magic?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/smite/god.rb', line 25

def magic?
  !physical?
end

#melee?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/smite/god.rb', line 17

def melee?
  !ranged?
end

#on_free_rotation?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/smite/god.rb', line 9

def on_free_rotation?
  !on_free_rotation.empty?
end

#physical?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/smite/god.rb', line 21

def physical?
  !!(type =~ /Physical/i)
end

#ranged?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/smite/god.rb', line 13

def ranged?
  !!(type =~ /Ranged/i)
end