rubyql 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +0 -0
- data/lib/rubyql.rb +35 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ff161429f1ce9cd5f0aeb8ff0e506709ae916c7c
|
4
|
+
data.tar.gz: 1229bce22970e2730c4fb96e7647ed8ad24aebe9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 76f777f681ed4c59b9715f8c37b3398b5fdaeef6ce33f98bcba94bdd9780f3676fd62bebd51b3ad6166a88117781fa5dd46cc796c84580330ca434382b6d43a3
|
7
|
+
data.tar.gz: 84b2a60a17d0b30aeb2016c69910b4b6f8d3c3a97d0dfd918b3e0604e23dd1966c08a131139ce35dd35ea787c1bea945740012ee6b9e5cb7287e0523dc1dfe5d
|
data/README.md
ADDED
File without changes
|
data/lib/rubyql.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
class RubyQL
|
2
|
+
attr_accessor :params
|
3
|
+
|
4
|
+
def initialize(params, json = false)
|
5
|
+
if json
|
6
|
+
@params = JSON.parse(params)
|
7
|
+
else
|
8
|
+
@params = params
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def execute
|
13
|
+
query.select do |key, value|
|
14
|
+
response_attr.key? key
|
15
|
+
end.merge query_params
|
16
|
+
end
|
17
|
+
|
18
|
+
def query_params
|
19
|
+
@params.reject do |key, value|
|
20
|
+
value == '' || value.nil?
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def response_attr
|
27
|
+
@params.select do |key, value|
|
28
|
+
value == '' || value.nil?
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def query; end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubyql
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Niklas Hanft
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-12-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Query language for ruby hashes
|
14
|
+
email: niklas.hanft@outlook.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- README.md
|
20
|
+
- lib/rubyql.rb
|
21
|
+
homepage: https://github.com/ParadoXxGER/rubyql
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.0.0
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.6.11
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: Query language for ruby hashes
|
45
|
+
test_files: []
|