Sha256: b4b1a45f115bec72cf8c07b9d37ca44a3cc2b67278a70958fa3430db4e7a332f

Contents?: true

Size: 440 Bytes

Versions: 4

Compression:

Stored size: 440 Bytes

Contents

module BulletJournal
  class Task
    attr_accessor :text, :complete

    def initialize(text:, complete: false, created_at: Time.now)
      @text = text
      @complete = complete
      @created_at = created_at
    end

    def to_h
      {
        text: text,
        complete: complete,
        created_at: Time.now.to_s
      }
    end

    def mark_as_complete
      @complete = true
      to_h
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bullit-0.1.2p1 lib/bullit/task.rb
bullit-0.1.2 lib/bullit/task.rb
bullit-0.1.1 lib/bullit/task.rb
bullit-0.1.0 lib/bullit/task.rb