class Todo
- Todo
- Reference
- Object
Overview
Todo Class
Represents a todo item.
Properties
#id
(type:String
): The unique identifier of the todo item.#title
(type:String
): The title or description of the todo item.completed
(type:Bool
, optional): Indicates whether the todo item is completed or not.
Example Usage
todo = Todo.new(1, "Buy groceries", false) puts todo.id # Output: 1 puts todo.title # Output: "Buy groceries" puts todo.completed # Output: false
Public Methods
.new(id : String, title : String, completed : Bool)
: Initializes a new instance of theTodo
class with the provided values for#id
,#title
, andcompleted
.
Defined in:
domain/models/todo.crConstructors
Instance Method Summary
- #completed=(completed : Bool)
- #completed? : Bool
- #id : String
- #id=(id : String)
- #title : String
- #title=(title : String)