Class: Cardio::Mod::Eat

Inherits:
Object show all
Includes:
Edibles
Defined in:
card/lib/cardio/mod/eat.rb,
card/lib/cardio/mod/eat/edibles.rb

Overview

import data from data directory of mods (list of card attributes) https://docs.google.com/document/d/13K_ynFwfpHwc3t5gnLeAkZJZHco1wK063nJNYwU8qfc/edit#

Defined Under Namespace

Modules: Edibles

Instance Method Summary collapse

Methods included from Edibles

#edibles

Constructor Details

#initialize(mod: nil, podtype: nil, user: nil, verbose: nil, name: nil) ⇒ Eat

Returns a new instance of Eat.



14
15
16
17
18
19
20
# File 'card/lib/cardio/mod/eat.rb', line 14

def initialize mod: nil, podtype: nil, user: nil, verbose: nil, name: nil
  @mod = mod
  @pod_type = podtype&.to_sym
  @name = name
  @user_id = user&.card_id
  @verbose = !verbose.nil?
end

Instance Method Details

#upObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'card/lib/cardio/mod/eat.rb', line 22

def up
  handle_up do
    edibles.each do |edible|
      track edible do
        current_user edible.delete(:user)
        time_machine edible.delete(:time) do
          Card.ensure edible
        end
      end
    end
  end
end