class CraftingTable::Recipe
A class representing a single recipe. A recipe has a name, one to n inputs, and one to n outputs.
@author Michael Senn <morrolan@morrolan.ch> @since 0.2
Attributes
input[R]
name[R]
output[R]
Public Class Methods
new(name, input, output)
click to toggle source
Create a new recipe.
@example Torch
recipe = Recipe.new('Torch', { Item.new('Coal', 263, 0) => 1, Item.new('Stick', 280, 0) => 1 }, { Item.new('Torch', 50, 0) => 4 })
@param [String] name The recipe’s name @param [Hash{Item => Integer}] input
A hash of items and their amounts which are required to craft the recipe.
@param [Hash{Item => Integer}] output
A hash of items and their amounts which you get when crafting the recipe.
# File lib/crafting_table/recipe.rb, line 28 def initialize(name, input, output) @name, @input, @output = name, input, output end