This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////// | |
// Begin Recipes // | |
/////////////////// | |
import { ADD_RECIPE, REMOVE_RECIPE } from '../actions'; | |
const defaultRecipes = [ | |
{ | |
title: 'Pumpkin Pie', | |
ingredients: 'Pumkin Puree, Sweetened Condensed Milk, Eggs, Pumkin Pie Spice, Pie Crust' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { addRecipe } from '../actions'; | |
import { connect } from 'react-redux'; | |
class AddRecipe extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
title: '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'byebug' | |
require './lib/save_game' | |
require './lib/load_game.rb' | |
require './lib/end_game.rb' | |
module Errors | |
class NotALetter < ArgumentError ; end | |
class TooManyLetters < ArgumentError ; end | |
class RepeatGuess < StandardError ; end | |
class RepeatName < StandardError ; end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
module SaveGame | |
def save_game | |
serialized_instance_variables = self.serialize_instance_variables | |
Dir.mkdir("save-files") unless Dir.exist?("save-files") | |
begin | |
if File.exist?("save-files/#{@player.name}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
module SaveGame | |
def save_game | |
serialized_instance_variables = self.serialize_instance_variables | |
Dir.mkdir("save-files") unless Dir.exist?("save-files") | |
begin | |
if File.exist?("save-files/#{@player.name}") |