Sha256: c5666fc20e29f04b2857aa5ee3ef363fea67c1134436a144a0619f1927b9d481

Contents?: true

Size: 851 Bytes

Versions: 1

Compression:

Stored size: 851 Bytes

Contents

module Nin
  class Item
    attr_accessor :body

    def initialize(desc)
      @desc = desc
    end

    def to_s
      "#{@desc}"
    end
  end

  class Todo
    attr_accessor :items

    def initialize()
      @items = load_items
    end

    def list
    end

    def add(todo)
    end

    def edit(id)
    end

    def delete(id)
    end

    private

    def load_items
      []
    end
  end
end

if __FILE__ == $0
  case ARGV[0]
  when 'l'
    Nin::Todo.new.list
  when 'a'
    Nin::Todo.new.add(ARGV[1])
  when 'e'
    Nin::Todo.new.edit(ARGV[1])
  when 'd'
    Nin::Todo.new.delete(ARGV[1])
  else
    puts "\nUSAGE: nin COMMAND [arguments...]\n\n"
    puts "COMMANDS:"
    puts "  l             List all todos"
    puts "  a desc        Add a todo"
    puts "  e id          Edit a todo"
    puts "  d id          Remove a todo"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nin-0.0.0 lib/nin.rb