Class: Oakdex::Pokemon::GrowthEvents::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/oakdex/pokemon/growth_events/base.rb

Overview

Represents Base GrowthEvent

Instance Method Summary collapse

Constructor Details

#initialize(pokemon, options = {}) ⇒ Base

Returns a new instance of Base.



7
8
9
10
# File 'lib/oakdex/pokemon/growth_events/base.rb', line 7

def initialize(pokemon, options = {})
  @pokemon = pokemon
  @options = options
end

Instance Method Details

#execute(_action = nil) ⇒ Object



24
25
26
# File 'lib/oakdex/pokemon/growth_events/base.rb', line 24

def execute(_action = nil)
  remove_event
end

#messageObject



20
21
22
# File 'lib/oakdex/pokemon/growth_events/base.rb', line 20

def message
  raise 'implement me'
end

#possible_actionsObject



16
17
18
# File 'lib/oakdex/pokemon/growth_events/base.rb', line 16

def possible_actions
  []
end

#read_only?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/oakdex/pokemon/growth_events/base.rb', line 12

def read_only?
  possible_actions.empty?
end

#to_hObject



28
29
30
31
32
33
# File 'lib/oakdex/pokemon/growth_events/base.rb', line 28

def to_h
  {
    name: self.class.name,
    options: @options
  }
end