Class: Evertils::Common::Query::Simple
- Inherits:
-
Base
show all
- Defined in:
- lib/evertils/common/query/simple.rb
Overview
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
Instance Method Details
#create_note_from_hash(conf) ⇒ Object
Also known as:
create_note
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
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
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
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
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
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
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
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
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
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
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
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
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
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
|
#notebooks ⇒ Object
7
8
9
|
# File 'lib/evertils/common/query/simple.rb', line 7
def notebooks
Entity::Notebooks.new.all
end
|
#notes_by_notebook(name) ⇒ Object
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
|
#poll ⇒ Object
131
132
133
134
|
# File 'lib/evertils/common/query/simple.rb', line 131
def poll
sync = Entity::Sync.new
sync.state
end
|
13
14
15
|
# File 'lib/evertils/common/query/simple.rb', line 13
def tags
Entity::Tags.new.all
end
|
#user_info ⇒ Object
138
139
140
141
|
# File 'lib/evertils/common/query/simple.rb', line 138
def user_info
auth = Authentication.instance
auth.info
end
|