struct Wakdata::RecipeIngredient
- Wakdata::RecipeIngredient
- Struct
- Value
- Object
Included Modules
- BSON::Serializable
- JSON::Serializable
- JSON::Serializable::Strict
- Wakdata::With::ItemId
- Wakdata::With::Quantity
- Wakdata::With::RecipeId
- YAML::Serializable
Defined in:
wakdata/recipe_ingredient.crConstructors
- .new(item_id : UInt32, recipe_id : UInt32, quantity : UInt32, ingredient_order : UInt8)
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(pull : JSON::PullParser)
-
.new(bson : BSON)
Allocate an instance and copies data from a BSON struct.
Class Method Summary
-
.from_bson(bson : BSON)
NOTE See
self.new
.
Instance Method Summary
- #[](value : String)
- #ingredient_order : UInt8
-
#to_bson(bson = BSON.new)
Converts to a BSON representation.
Instance methods inherited from module Wakdata::With::Quantity
quantity : UInt32
quantity
Instance methods inherited from module Wakdata::With::RecipeId
recipe(item_types : Array(Wakdata::Recipe)) : Wakdata::Recipe | Nil
recipe,
recipe_id : UInt32
recipe_id
Instance methods inherited from module Wakdata::With::ItemId
item(items : Array(Wakdata::Item), jobItems : Array(Wakdata::JobItem)) : Wakdata::Item | Wakdata::JobItem | Nilitem(items : Array(Wakdata::Item)) : Wakdata::Item | Nil
item(jobItems : Array(Wakdata::JobItem)) : Wakdata::JobItem | Nil item, item_id : UInt32 item_id
Constructor Detail
def self.new(item_id : UInt32, recipe_id : UInt32, quantity : UInt32, ingredient_order : UInt8)
#
def self.new(bson : BSON)
#
Allocate an instance and copies data from a BSON struct.
class User
include BSON::Serializable
property name : String
end
data = BSON.new
data["name"] = "John"
User.new(data)
Class Method Detail
Instance Method Detail
def to_bson(bson = BSON.new)
#
Converts to a BSON representation.
user = User.new name: "John"
bson = user.to_bson