struct Waknax::Month
- Waknax::Month
- Struct
- Value
- Object
Included Modules
- BSON::Serializable
- JSON::Serializable
- JSON::Serializable::Strict
- Waknax::With::Color
- Waknax::With::Id
- YAML::Serializable
Defined in:
waknax/month.crConstructors
- .new(id : UInt16, month : UInt8, name : String, color : String, background : Bool, background_url : Bool, protector_name : String, protector_description : String, protector_image_url : String)
- .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)
- #background : Bool
- #background_url : Bool
- #month : UInt8
- #name : String
- #protector_description : String
- #protector_image_url : String
- #protector_name : String
-
#to_bson(bson = BSON.new)
Converts to a BSON representation.
Instance methods inherited from module Waknax::With::Color
color : String
color
Instance methods inherited from module Waknax::With::Id
id : UInt16
id
Constructor Detail
def self.new(id : UInt16, month : UInt8, name : String, color : String, background : Bool, background_url : Bool, protector_name : String, protector_description : String, protector_image_url : String)
#
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