class Turn
- Turn
- ApplicationRecord
- Jennifer::Model::Base
- Jennifer::Model::Resource
- Reference
- Object
Overview
This is a DB record representation of a request from a game for either start/move/end request.
NOTE https://imdrasil.github.io/jennifer.cr/docs/model_mapping
Defined in:
models/turn.crConstructors
-
.new(values : Hash(Symbol, AttrType) | NamedTuple, new_record)
Accepts symbol hash or named tuple, stringify it and calls constructor with string-based keys hash.
Class Method Summary
- ._context
- ._created_at
- ._dead
- ._game_id
- ._id
- ._path
- ._snake_id
- ._updated_at
- .column_names : Array(String)
Instance Method Summary
- #context : String
- #context!
- #context=(_context : String)
- #context=(_context : AttrType)
- #context_changed? : Bool
- #context_will_change!
- #created_at : Time?
- #created_at!
- #created_at=(_created_at : Union(Time, Nil))
- #created_at=(_created_at : String)
- #created_at=(_created_at : AttrType)
- #created_at_changed? : Bool
- #created_at_will_change!
- #dead : Bool
- #dead!
- #dead=(_dead : Bool)
- #dead=(_dead : String)
- #dead=(_dead : AttrType)
- #dead?
- #dead_changed? : Bool
- #dead_will_change!
-
#destroy : Bool
Deletes object from db and calls all related callbacks.
- #game_id : String
- #game_id!
- #game_id=(_game_id : String)
- #game_id=(_game_id : AttrType)
- #game_id_changed? : Bool
- #game_id_will_change!
- #id : Int64?
- #id!
- #id=(_id : Union(Int64, Nil))
- #id=(_id : String)
- #id=(_id : Int32)
- #id=(_id : AttrType)
- #id_changed? : Bool
- #id_will_change!
- #path : String
- #path!
- #path=(_path : String)
- #path=(_path : AttrType)
- #path_changed? : Bool
- #path_will_change!
- #snake_id : String
- #snake_id!
- #snake_id=(_snake_id : String)
- #snake_id=(_snake_id : AttrType)
- #snake_id_changed? : Bool
- #snake_id_will_change!
- #track_timestamps_on_create
- #track_timestamps_on_update
- #updated_at : Time?
- #updated_at!
- #updated_at=(_updated_at : Union(Time, Nil))
- #updated_at=(_updated_at : String)
- #updated_at=(_updated_at : AttrType)
- #updated_at_changed? : Bool
- #updated_at_will_change!
Constructor Detail
Accepts symbol hash or named tuple, stringify it and calls constructor with string-based keys hash.
Class Method Detail
Instance Method Detail
def destroy : Bool
#
Description copied from class Jennifer::Model::Base
Deletes object from db and calls all related callbacks.
It returns true
if the object was successfully deleted.
Contact.first!.destroy # => true