Sha256: b061e20797f911f30f663c2d8ff75bddb707fc8879177a5731ed2fbd42e844e8

Contents?: true

Size: 456 Bytes

Versions: 4

Compression:

Stored size: 456 Bytes

Contents

module Intent
  module Verbs
    class Add
      def initialize(documents)
        @documents = documents
      end

      def invoke_prepend(scope, noun)
        ledger = @documents.send(scope)
        ledger.prepend(new Todo::Task(noun.todo_s))
        ledger.save!
      end

      def invoke_append(ledger, noun)
        ledger = @documents.send(scope)
        ledger.append(new Todo::Task(noun.todo_s))
        ledger.save!
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
intent-0.8.1 lib/intent/verbs/add.rb
intent-0.8.0 lib/intent/verbs/add.rb
intent-0.7.1 lib/intent/verbs/add.rb
intent-0.7.0 lib/intent/verbs/add.rb