Method: Springpad.add

Defined in:
lib/springpad.rb

.add(type, options) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/springpad.rb', line 26

def self.add(type, options)
  cli = Springpad::CLI.new
  options = {}
  options.merge({:public => false}) if options[:private]
  contents = cli.edit

  api = Springpad::API.new
  case type
  when "note"
    p api.add_note(contents, options)
  when "task"
    p api.add_task(contents, options)
  end
end