class List
Defined in:
todo_api/models/list.crConstant Summary
-
MAX_LISTS_PER_USER =
20
Constructors
- .new(id : Int32, user_email : String, user_name : Nil | String, name : String, todos : JSON::Any, additional_users : JSON::Any, created_on : Time, updated_on : Time)
- .new(user_email : String, user_name : Nil | String, name : String, todos : JSON::Any, additional_users : JSON::Any)
- .new(pull : JSON::PullParser)
- .new(rs : DB::ResultSet)
Class Method Summary
-
.all(user_email : String) : Array(List)
Get all lists that the user has access to.
-
.get(id : String) : List | Nil
Get a single list by ID.
Instance Method Summary
- #additional_users : JSON::Any
- #additional_users=(additional_users : JSON::Any)
- #created_on : Time
-
#delete
Delete this list.
-
#has_access?(current_user_email) : Bool
Returns wether the user has access to this list.
- #id : Int32
- #name : String
- #name=(name : String)
-
#save
Upsert this list.
-
#to_h(summarise_todos = false)
Returns this list as a Hash with/without the todos (for performance).
-
#todo_summary
Returns a Hash containing a summary of the todos as statistics.
- #todos : JSON::Any
- #todos=(todos : JSON::Any)
- #updated_on : Time
- #user_email : String
- #user_name : String | Nil
Instance methods inherited from class Model
now(timezone = "UTC")
now
Constructor methods inherited from class Model
new(pull : JSON::PullParser)
new
Constructor Detail
def self.new(id : Int32, user_email : String, user_name : Nil | String, name : String, todos : JSON::Any, additional_users : JSON::Any, created_on : Time, updated_on : Time)
#
def self.new(user_email : String, user_name : Nil | String, name : String, todos : JSON::Any, additional_users : JSON::Any)
#
Class Method Detail
Get all lists that the user has access to.
Instance Method Detail
def to_h(summarise_todos = false)
#
Returns this list as a Hash with/without the todos (for performance).