Class: Evertils::Common::Query::Simple

Inherits:
Base show all
Defined in:
lib/evertils/common/query/simple.rb

Overview

Since:

  • 0.3.0

Instance Method Summary collapse

Methods inherited from Base

#end_of_day, #start_of_day

Methods inherited from Generic

#bytesize, #deprecation_notice, #encoding, #force_encoding, #has_required_fields, #initialize

Constructor Details

This class inherits a constructor from Evertils::Common::Generic

Instance Method Details

#create_note_from_hash(conf) ⇒ Object Also known as: create_note

Since:

  • 0.3.3



62
63
64
65
# File 'lib/evertils/common/query/simple.rb', line 62

def create_note_from_hash(conf)
  entity = Manager::Note.instance
  entity.create(conf)
end

#create_note_from_yml(full_path) ⇒ Object

Since:

  • 0.2.0



34
35
36
37
# File 'lib/evertils/common/query/simple.rb', line 34

def create_note_from_yml(full_path)
  entity = Entity::Note.new
  entity.create_from_yml(full_path)
end

#create_notebook(name, stack = nil) ⇒ Object

Since:

  • 0.2.0



48
49
50
51
# File 'lib/evertils/common/query/simple.rb', line 48

def create_notebook(name, stack = nil)
  entity = Entity::Notebook.new
  entity.create(name, stack)
end

#create_notebooks_from_yml(full_path) ⇒ Object

Since:

  • 0.2.0



41
42
43
44
# File 'lib/evertils/common/query/simple.rb', line 41

def create_notebooks_from_yml(full_path)
  entity = Entity::Notebooks.new
  entity.create_from_yml(full_path)
end

#create_stack_from_yml(full_path) ⇒ Object

Since:

  • 0.2.0



27
28
29
30
# File 'lib/evertils/common/query/simple.rb', line 27

def create_stack_from_yml(full_path)
  stack = Entity::Stack.new
  stack.create_from_yml(full_path)
end

#create_tag(name) ⇒ Object

Since:

  • 0.3.1



55
56
57
58
# File 'lib/evertils/common/query/simple.rb', line 55

def create_tag(name)
  entity = Manager::Tag.instance
  entity.create(name)
end

#destroy_note(name) ⇒ Object

Since:

  • 0.2.0



123
124
125
126
127
# File 'lib/evertils/common/query/simple.rb', line 123

def destroy_note(name)
  entity = Manager::Note.instance
  note = entity.find(name)
  note.expunge!
end

#find_note(name) ⇒ Object

Since:

  • 0.2.0



70
71
72
73
# File 'lib/evertils/common/query/simple.rb', line 70

def find_note(name)
  entity = Manager::Note.instance
  entity.find(name)
end

#find_note_contents(name) ⇒ Object

Since:

  • 0.3.4



84
85
86
87
# File 'lib/evertils/common/query/simple.rb', line 84

def find_note_contents(name)
  entity = Manager::Note.instance
  entity.find_with_contents(name)
end

#find_note_contents_using_grammar(grammar) ⇒ Object

Since:

  • 0.3.4



91
92
93
94
# File 'lib/evertils/common/query/simple.rb', line 91

def find_note_contents_using_grammar(grammar)
  entity = Manager::Note.instance
  entity.find_note_contents_using_grammar(grammar)
end

#find_notebook(name) ⇒ Object

Since:

  • 0.3.1



98
99
100
101
# File 'lib/evertils/common/query/simple.rb', line 98

def find_notebook(name)
  entity = Manager::Notebook.instance
  entity.find(name)
end

#find_with(conf) ⇒ Object

Since:

  • 0.3.13



77
78
79
80
# File 'lib/evertils/common/query/simple.rb', line 77

def find_with(conf)
  entity = Manager::Note.instance
  entity.find_with(conf)
end

#note_exists(name) ⇒ Object

Since:

  • 0.2.0



115
116
117
118
119
# File 'lib/evertils/common/query/simple.rb', line 115

def note_exists(name)
  entity = Manager::Note.instance
  note = entity.find(name)
  note.exists?
end

#notebook_by_name(name) ⇒ Object

Deprecated.

0.3.1

Since:

  • 0.2.0



106
107
108
109
110
111
# File 'lib/evertils/common/query/simple.rb', line 106

def notebook_by_name(name)
  deprecation_notice('0.3.1', 'Replaced by #find_notebook method.  Will be removed in 0.4.0')

  entity = Manager::Notebook.instance
  entity.find(name)
end

#notebooksObject

Since:

  • 0.2.0



7
8
9
# File 'lib/evertils/common/query/simple.rb', line 7

def notebooks
  Entity::Notebooks.new.all
end

#notes_by_notebook(name) ⇒ Object

Since:

  • 0.2.0



19
20
21
22
23
# File 'lib/evertils/common/query/simple.rb', line 19

def notes_by_notebook(name)
  entity = Manager::Notebook.instance
  nb = entity.find(name)
  nb.notes
end

#pollObject

Since:

  • 0.2.0



131
132
133
134
# File 'lib/evertils/common/query/simple.rb', line 131

def poll
  sync = Entity::Sync.new
  sync.state
end

#tagsObject

Since:

  • 0.2.0



13
14
15
# File 'lib/evertils/common/query/simple.rb', line 13

def tags
  Entity::Tags.new.all
end

#user_infoObject

Since:

  • 0.3.7



138
139
140
141
# File 'lib/evertils/common/query/simple.rb', line 138

def 
  auth = Authentication.instance
  auth.info
end