Sha256: 5d8ad62b673c8fc5c86f093f8e64ff1eade592b8fbf7e8776eb37d91f0da1cbe
Contents?: true
Size: 630 Bytes
Versions: 5
Compression:
Stored size: 630 Bytes
Contents
module TaskwarriorWeb class Annotation attr_accessor :task_id, :entry, :description, :_errors def initialize(attributes = {}) attributes.each do |attr, value| send("#{attr}=", value) if respond_to?(attr.to_sym) end @_errors = [] end def save! Command.new(:annotate, self.task_id, { :description => self.description }).run end def delete! Command.new(:denotate, self.task_id, { :description => self.description }).run end def is_valid? @_errors << 'You must provide a description' if self.description.blank? @_errors.empty? end end end
Version data entries
5 entries across 5 versions & 1 rubygems