dgrid 0.0.2
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 +15 -0
- data/lib/dgrid.rb +1 -0
- data/lib/dgrid/api.rb +20 -0
- data/lib/dgrid/api/connection.rb +444 -0
- data/lib/dgrid/api/entity.rb +89 -0
- data/lib/dgrid/api/get_test_login_info.rb +19 -0
- data/lib/dgrid/api/gps_coordinates.rb +14 -0
- data/lib/dgrid/api/incident.rb +78 -0
- data/lib/dgrid/api/item.rb +60 -0
- data/lib/dgrid/api/keyword.rb +38 -0
- data/lib/dgrid/api/lens.rb +38 -0
- data/lib/dgrid/api/link.rb +40 -0
- data/lib/dgrid/api/named_entity.rb +20 -0
- data/lib/dgrid/api/organization.rb +28 -0
- data/lib/dgrid/api/person.rb +39 -0
- data/lib/dgrid/api/place.rb +47 -0
- data/lib/dgrid/api/workspace.rb +567 -0
- data/lib/dgrid/argument_validation.rb +17 -0
- data/lib/dgrid/set_members_from_hash.rb +41 -0
- metadata +90 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
module Dgrid
|
2
|
+
module ArgumentValidation
|
3
|
+
|
4
|
+
def self.included(base)
|
5
|
+
base.extend ClassMethods
|
6
|
+
end
|
7
|
+
|
8
|
+
module ClassMethods
|
9
|
+
|
10
|
+
def option(name, class_or_validator, required = nil)
|
11
|
+
end
|
12
|
+
|
13
|
+
def argument(name, class_or_validator)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Dgrid
|
2
|
+
module SetMembersFromHash
|
3
|
+
def set_members_from_hash(h)
|
4
|
+
h.each do |key, val|
|
5
|
+
raise "non-symbolic key #{key}" unless key.is_a?(Symbol)
|
6
|
+
member_name = "@#{key}"
|
7
|
+
instance_variable_set(member_name, val)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
require 'set'
|
12
|
+
# split a hash into two hashes whose keys are either in or not in criteria_set
|
13
|
+
# criteria_set can be a Set or anything that can be used to construct a Set
|
14
|
+
def split_hash(h , criteria_set)
|
15
|
+
local_cs = criteria_set.is_a?(Set) ? criteria_set : Set.new(criteria_set)
|
16
|
+
haves = {}
|
17
|
+
have_nots = {}
|
18
|
+
h.each do |k,v|
|
19
|
+
if local_cs.include?(k)
|
20
|
+
haves[k] = v
|
21
|
+
else
|
22
|
+
have_nots[k] = v
|
23
|
+
end
|
24
|
+
end
|
25
|
+
return haves, have_nots
|
26
|
+
end
|
27
|
+
|
28
|
+
def change_string_keys_to_symbol_keys(hash)
|
29
|
+
result = {}
|
30
|
+
hash.each_pair do |k,v|
|
31
|
+
if k.is_a?(String)
|
32
|
+
result[k.to_sym] = v
|
33
|
+
else
|
34
|
+
result[k] = v
|
35
|
+
end
|
36
|
+
end
|
37
|
+
result
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dgrid
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- DecisionGrid
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-01-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: json
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: RubyGem used to access DecisionGrid
|
42
|
+
email: support@decisiongrid.com
|
43
|
+
executables: []
|
44
|
+
extensions: []
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
47
|
+
- lib/dgrid/api/connection.rb
|
48
|
+
- lib/dgrid/api/entity.rb
|
49
|
+
- lib/dgrid/api/get_test_login_info.rb
|
50
|
+
- lib/dgrid/api/gps_coordinates.rb
|
51
|
+
- lib/dgrid/api/incident.rb
|
52
|
+
- lib/dgrid/api/item.rb
|
53
|
+
- lib/dgrid/api/keyword.rb
|
54
|
+
- lib/dgrid/api/lens.rb
|
55
|
+
- lib/dgrid/api/link.rb
|
56
|
+
- lib/dgrid/api/named_entity.rb
|
57
|
+
- lib/dgrid/api/organization.rb
|
58
|
+
- lib/dgrid/api/person.rb
|
59
|
+
- lib/dgrid/api/place.rb
|
60
|
+
- lib/dgrid/api/workspace.rb
|
61
|
+
- lib/dgrid/api.rb
|
62
|
+
- lib/dgrid/argument_validation.rb
|
63
|
+
- lib/dgrid/set_members_from_hash.rb
|
64
|
+
- lib/dgrid.rb
|
65
|
+
homepage: https://github.com/decisiongrid
|
66
|
+
licenses:
|
67
|
+
- MIT
|
68
|
+
metadata: {}
|
69
|
+
post_install_message:
|
70
|
+
rdoc_options: []
|
71
|
+
require_paths:
|
72
|
+
- lib
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.9.2
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
requirements: []
|
84
|
+
rubyforge_project:
|
85
|
+
rubygems_version: 2.1.10
|
86
|
+
signing_key:
|
87
|
+
specification_version: 4
|
88
|
+
summary: DecisionGrid client API
|
89
|
+
test_files: []
|
90
|
+
has_rdoc:
|