Module: OSCRuby::QueryModule

Extended by:
NormalizeModule, ValidationsModule
Included in:
QueryResults
Defined in:
lib/osc_ruby/modules/query_module.rb

Class Method Summary collapse

Methods included from ValidationsModule

attr_hash_exists_and_is_type_of, check_attributes, check_attributes_request, check_client, check_for_id, check_for_names, check_for_parents, check_interfaces, check_obj_for_errors, check_object_for_id, check_query, extract_attributes

Methods included from NormalizeModule

iterate_through_rows, normalize

Class Method Details

.create(rn_client, resource, json_content) ⇒ Object



33
34
35
36
37
# File 'lib/osc_ruby/modules/query_module.rb', line 33

def create(rn_client,resource,json_content)

	OSCRuby::Connect.post_or_patch(rn_client,resource,json_content)

end

.destroy(rn_client, resource) ⇒ Object



45
46
47
48
49
# File 'lib/osc_ruby/modules/query_module.rb', line 45

def destroy(rn_client,resource)

	OSCRuby::Connect.delete(rn_client,resource)
	
end

.find(rn_client, resource) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/osc_ruby/modules/query_module.rb', line 14

def find(rn_client,resource)

	obj_to_find = OSCRuby::Connect.get(rn_client,resource)

	if obj_to_find.code.to_i == 200 || obj_to_find.code.to_i == 201

		# ValidationsModule::check_obj_for_errors(obj_to_find)

		NormalizeModule::normalize(obj_to_find)
	else

		puts obj_to_find.body

		obj_to_find.body

	end

end

.update(rn_client, resource, json_content) ⇒ Object



39
40
41
42
43
# File 'lib/osc_ruby/modules/query_module.rb', line 39

def update(rn_client,resource,json_content)

	OSCRuby::Connect.post_or_patch(rn_client,resource,json_content,true)

end