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

#assassin?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/smite/god.rb', line 42

def assassin?
  !!(roles =~ /Assassin/)
end

#chinese?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/smite/god.rb', line 82

def chinese?
  !!(pantheon =~ /Chinese/)
end

#egyptian?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/smite/god.rb', line 70

def egyptian?
  !!(pantheon =~ /Egyptian/)
end

#greek?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/smite/god.rb', line 62

def greek?
  !!(pantheon =~ /Greek/)
end

#guardian?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/smite/god.rb', line 46

def guardian?
  !!(roles =~ /Guardian/)
end

#hindu?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/smite/god.rb', line 54

def hindu?
  !!(pantheon =~ /Hindu/)
end

#hunter?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/smite/god.rb', line 38

def hunter?
  !!(roles =~ /Hunter/)
end

#inspectObject



90
91
92
# File 'lib/smite/god.rb', line 90

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

#japanese?Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/smite/god.rb', line 74

def japanese?
  !!(pantheon =~ /Japanese/)
end

#mage?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/smite/god.rb', line 34

def mage?
  !!(roles =~ /Mage/)
end

#magic?Boolean Also known as: magical?

Returns:

  • (Boolean)


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

def magic?
  !physical?
end

#mayan?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/smite/god.rb', line 58

def mayan?
  !!(pantheon =~ /Mayan/)
end

#melee?Boolean

Returns:

  • (Boolean)


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

def melee?
  !ranged?
end

#norse?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/smite/god.rb', line 78

def norse?
  !!(pantheon =~ /Norse/)
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) || !!(role =~ /Hunter|Warrior|Assassin/i)
end

#ranged?Boolean

Returns:

  • (Boolean)


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

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

#roleObject



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

def role
  @role ||= roles.strip
end

#roman?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/smite/god.rb', line 66

def roman?
  !!(pantheon =~ /Roman/)
end

#short_loreObject



86
87
88
# File 'lib/smite/god.rb', line 86

def short_lore
  lore.split('.')[0..2].join('.') + '.'
end

#warrior?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/smite/god.rb', line 50

def warrior?
  !!(roles =~ /Warrior/)
end