Class: QuiverToolbox::API::CreateNote

Inherits:
Object
  • Object
show all
Defined in:
lib/quiver_toolbox/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, body, attr) ⇒ CreateNote

Returns a new instance of CreateNote.



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/quiver_toolbox/api.rb', line 34

def initialize(title, body, attr)
  @result = nil
  @note = QuiverToolbox::Note.new(attr)
  @note.file = File.join(attr['notebook_path'], @note.file_name)
  @note.title = title
  @note.cells = [
    {
      'type' => attr['type'],
      'data' => body
    }
  ]
end

Instance Attribute Details

#noteObject (readonly)

Returns the value of attribute note.



33
34
35
# File 'lib/quiver_toolbox/api.rb', line 33

def note
  @note
end

#resultObject (readonly)

Returns the value of attribute result.



33
34
35
# File 'lib/quiver_toolbox/api.rb', line 33

def result
  @result
end

Instance Method Details

#execObject



47
48
49
# File 'lib/quiver_toolbox/api.rb', line 47

def exec
  self
end

#storeObject



51
52
53
54
55
# File 'lib/quiver_toolbox/api.rb', line 51

def store
  @note.store
  @result = @note.file
  self
end