Sha256: a52bfa723344c7c0699be6f5a2ee8b68e5c8aef142243c27f9f35a3dca18e17d

Contents?: true

Size: 502 Bytes

Versions: 2

Compression:

Stored size: 502 Bytes

Contents

# frozen_string_literal: true

module Howzit
  class Task
    attr_reader :type, :title, :action, :parent, :optional, :default

    def initialize(type, title, action, parent = nil, optional: false, default: true)
      @type = type
      @title = title
      @action = action.render_arguments
      @parent = parent
      @optional = optional
      @default = default
    end

    def to_s
      @title
    end

    def to_list
      "    * #{@type}: #{@title.gsub(/\\n/, '\​n')}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
howzit-2.0.6 lib/howzit/task.rb
howzit-2.0.5 lib/howzit/task.rb