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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b81238ef90e9f6ad5449481deabe442229c15487001728050f9f14cd722a3dc
4
- data.tar.gz: b1c2e16056f0a34806ec5ce02486f6faaee60acfa6a48d80ca2dbccb499940c1
3
+ metadata.gz: 32b69d5ef3104c96ea8e92fe932f0019ac147a6a9c6efe7c73f6c155e8d6d98e
4
+ data.tar.gz: cf0d9d2f578e5d9c73ef28fc2bbd84a6eba0f2e3c60ce4b8cd76806c6fe54c2c
5
5
  SHA512:
6
- metadata.gz: 6f701de397e728f0e4fdfb786bd08d5bea40b484365575f80862ea13fa677e315c45b36fe69c97301fa504e1fc8e94171d79f940ed399a67dc4717c39addbbd5
7
- data.tar.gz: f5b8a4a19850e28dae356f143a6346407c3c2acde12e3c826d70538ae7639ae38f7b7b9f013c6df2dd85d29c14fa5d6d22946ec40b61eb684d206d59a7f39615
6
+ metadata.gz: be522f1507621eb6ce043f9546b8006abdc9946160e29ec51d169cfc10dd0e80b06216b2de48a83282e0c25d56e63474c5b81a4007aa9db45cbfcd536d7855d1
7
+ data.tar.gz: 10578dc66e48e72fbf674cf62a3b31182cd819ac7335aebaf0ee5e40dc814592ef3d46bfc53a110f476e54bf44f1eaa42fc60234141432985053b1825474503b
@@ -1,8 +1,10 @@
1
1
  require "httparty"
2
2
  require "legistar/version"
3
- require "legistar/actions"
4
- require "legistar/bodies"
5
- # require "pry" # Note: Helpful during development
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
 
@@ -1,5 +1,5 @@
1
1
  module Legistar
2
- class Actions
2
+ class Action
3
3
  include HTTParty
4
4
  base_uri 'https://webapi.legistar.com'
5
5
 
@@ -1,5 +1,5 @@
1
1
  module Legistar
2
- class Bodies
2
+ class Body
3
3
  include HTTParty
4
4
  base_uri 'https://webapi.legistar.com'
5
5
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Legistar
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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.1
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/actions.rb
102
- - lib/legistar/bodies.rb
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: