Class: Yinx::SQL::JsonBatch

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/yinx_sql/json_batch.rb

Instance Method Summary collapse

Instance Method Details

#booksObject



4
5
6
7
8
9
# File 'lib/yinx_sql/json_batch.rb', line 4

def books
  batch.
    map { |note| [note['notebookGuid'], note['book']] }.
    uniq.
    map { |id_name| id_name[1] }
end

#stacksObject



11
12
13
14
15
# File 'lib/yinx_sql/json_batch.rb', line 11

def stacks
  batch.
    map { |note| note['stack'] }.
    uniq
end

#tagsObject



17
18
19
20
21
22
# File 'lib/yinx_sql/json_batch.rb', line 17

def tags
  batch.
    map { |note| note['tags'] }.
    flatten.
    uniq
end