legistar 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/legistar.rb +5 -9
- data/lib/legistar/{actions.rb → action.rb} +1 -1
- data/lib/legistar/{bodies.rb → body.rb} +1 -1
- data/lib/legistar/body_type.rb +41 -0
- data/lib/legistar/code_section.rb +45 -0
- data/lib/legistar/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32b69d5ef3104c96ea8e92fe932f0019ac147a6a9c6efe7c73f6c155e8d6d98e
|
4
|
+
data.tar.gz: cf0d9d2f578e5d9c73ef28fc2bbd84a6eba0f2e3c60ce4b8cd76806c6fe54c2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be522f1507621eb6ce043f9546b8006abdc9946160e29ec51d169cfc10dd0e80b06216b2de48a83282e0c25d56e63474c5b81a4007aa9db45cbfcd536d7855d1
|
7
|
+
data.tar.gz: 10578dc66e48e72fbf674cf62a3b31182cd819ac7335aebaf0ee5e40dc814592ef3d46bfc53a110f476e54bf44f1eaa42fc60234141432985053b1825474503b
|
data/lib/legistar.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require "httparty"
|
2
2
|
require "legistar/version"
|
3
|
-
require "legistar/
|
4
|
-
require "legistar/
|
5
|
-
|
3
|
+
require "legistar/action"
|
4
|
+
require "legistar/body"
|
5
|
+
require "legistar/body_type"
|
6
|
+
require "legistar/code_section"
|
7
|
+
require "pry" # Note: Helpful during development
|
6
8
|
|
7
9
|
module Legistar
|
8
10
|
include HTTParty
|
@@ -16,12 +18,6 @@ module Legistar
|
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
19
|
-
class BodyTypes
|
20
|
-
end
|
21
|
-
|
22
|
-
class CodeSections
|
23
|
-
end
|
24
|
-
|
25
21
|
class EventItems
|
26
22
|
end
|
27
23
|
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Legistar
|
2
|
+
class BodyType
|
3
|
+
include HTTParty
|
4
|
+
base_uri 'https://webapi.legistar.com'
|
5
|
+
|
6
|
+
def initialize(host:)
|
7
|
+
@host = host
|
8
|
+
end
|
9
|
+
|
10
|
+
# Example Response
|
11
|
+
#
|
12
|
+
# {
|
13
|
+
# "BodyTypeId"=>42,
|
14
|
+
# "BodyTypeGuid"=>"B3C517AA-98B9-44BF-A3DE-7B9E8B4ACB5A",
|
15
|
+
# "BodyTypeLastModifiedUtc"=>"2014-05-24T04:15:18.647",
|
16
|
+
# "BodyTypeRowVersion"=>"AAAAAAA0AeY=",
|
17
|
+
# "BodyTypeName"=>"City Council"
|
18
|
+
# }
|
19
|
+
def index
|
20
|
+
response = self.class.get("/v1/#{@host}/BodyTypes")
|
21
|
+
actions = response.to_a
|
22
|
+
end
|
23
|
+
|
24
|
+
def get(id)
|
25
|
+
response = self.class.get("/v1/#{@host}/BodyTypes/#{id}")
|
26
|
+
response.to_h
|
27
|
+
end
|
28
|
+
|
29
|
+
def create(options = {})
|
30
|
+
response = self.class.post("/v1/#{@host}/BodyTypes/", options)
|
31
|
+
end
|
32
|
+
|
33
|
+
def update(id, options = {})
|
34
|
+
response = self.class.put("/v1/#{@host}/BodyTypes/#{id}", options)
|
35
|
+
end
|
36
|
+
|
37
|
+
def destroy(id)
|
38
|
+
response = self.class.delete("/v1/#{@host}/BodyTypes/#{id}")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Legistar
|
2
|
+
class CodeSection
|
3
|
+
include HTTParty
|
4
|
+
base_uri 'https://webapi.legistar.com'
|
5
|
+
|
6
|
+
def initialize(host:)
|
7
|
+
@host = host
|
8
|
+
end
|
9
|
+
|
10
|
+
# Example Response
|
11
|
+
#
|
12
|
+
# {
|
13
|
+
# "CodeSectionId"=>38,
|
14
|
+
# "CodeSectionGuid"=>"A24F2163-A67F-47EE-860C-EDA29BACFE37",
|
15
|
+
# "CodeSectionLastModifiedUtc"=>"2014-05-24T04:15:19.107",
|
16
|
+
# "CodeSectionRowVersion"=>"AAAAAAAFsMc=",
|
17
|
+
# "CodeSectionNumber"=>"11.222",
|
18
|
+
# "CodeSectionName"=>"Water ",
|
19
|
+
# "CodeSectionActiveFlag"=>1,
|
20
|
+
# "CodeSectionUsedFlag"=>0
|
21
|
+
# }
|
22
|
+
#
|
23
|
+
def index
|
24
|
+
response = self.class.get("/v1/#{@host}/CodeSections")
|
25
|
+
actions = response.to_a
|
26
|
+
end
|
27
|
+
|
28
|
+
def get(id)
|
29
|
+
response = self.class.get("/v1/#{@host}/CodeSections/#{id}")
|
30
|
+
response.to_h
|
31
|
+
end
|
32
|
+
|
33
|
+
def create(options = {})
|
34
|
+
response = self.class.post("/v1/#{@host}/CodeSections/", options)
|
35
|
+
end
|
36
|
+
|
37
|
+
def update(id, options = {})
|
38
|
+
response = self.class.put("/v1/#{@host}/CodeSections/#{id}", options)
|
39
|
+
end
|
40
|
+
|
41
|
+
def destroy(id)
|
42
|
+
response = self.class.delete("/v1/#{@host}/CodeSections/#{id}")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/legistar/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: legistar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Wold
|
@@ -98,8 +98,10 @@ files:
|
|
98
98
|
- bin/setup
|
99
99
|
- legistar.gemspec
|
100
100
|
- lib/legistar.rb
|
101
|
-
- lib/legistar/
|
102
|
-
- lib/legistar/
|
101
|
+
- lib/legistar/action.rb
|
102
|
+
- lib/legistar/body.rb
|
103
|
+
- lib/legistar/body_type.rb
|
104
|
+
- lib/legistar/code_section.rb
|
103
105
|
- lib/legistar/version.rb
|
104
106
|
homepage: https://github.com/afomi/legistar
|
105
107
|
licenses:
|