google-civic-ruby 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/google-civic/connection.rb +9 -17
- data/lib/google-civic/representation.rb +2 -0
- data/lib/google-civic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bee84ec2b2400c0f726712fcd324c9a30b6f1820
|
4
|
+
data.tar.gz: 46445c19ed1e2d0636261d613068c4b2e40ddda2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4df21da6687111831ebaf9068f2bed626e9782ae1743dd3b5e85e08f206efa61677e998cf1e40fd538cf9b26d235142a2b4dac1b352f009f463a9f8dd4a6450e
|
7
|
+
data.tar.gz: 1f7f60c22dbba35f9813f54a5dfcdf6fb69c458ca3b7c66f26214e9d5e0a14b5200551049322859b5ed303f0b7ed4dc8f1977af901e32451a98d0f5bf4848626
|
data/README.md
CHANGED
@@ -17,7 +17,16 @@ Or install it yourself as:
|
|
17
17
|
|
18
18
|
## Usage
|
19
19
|
|
20
|
+
Coming soon...
|
20
21
|
|
22
|
+
## Credits
|
23
|
+
|
24
|
+
Authored by Adam Cuppy (@acuppy) of Coding ZEAL (http://codingzeal.com)
|
25
|
+
|
26
|
+
![Coding ZEAL](https://googledrive.com/host/0B3TWa6M1MsWeWmxRZWhscllwTzA/ZEAL-logo-final-150.png)
|
27
|
+
|
28
|
+
This is freely distributed under the MIT license. Use it, modify it,
|
29
|
+
enjoy :)
|
21
30
|
|
22
31
|
## Contributing
|
23
32
|
|
@@ -1,26 +1,22 @@
|
|
1
1
|
require "faraday"
|
2
2
|
require "faraday_middleware"
|
3
|
+
require "delegate"
|
3
4
|
|
4
5
|
module Google
|
5
6
|
module Civic
|
6
|
-
class Connection
|
7
|
-
attr_writer :base_url
|
8
|
-
|
9
|
-
def initialize(params={})
|
10
|
-
@base_url = params.delete(:base_url)
|
11
|
-
establish!
|
12
|
-
end
|
7
|
+
class Connection < SimpleDelegator
|
13
8
|
|
14
|
-
|
15
|
-
resource.get(*args, &block)
|
16
|
-
end
|
9
|
+
attr_writer :base_url
|
17
10
|
|
18
|
-
def
|
19
|
-
|
11
|
+
def initialize(opts={})
|
12
|
+
self.base_url = opts.fetch(:base_url, "")
|
13
|
+
super(resource)
|
20
14
|
end
|
21
15
|
|
22
16
|
private
|
23
17
|
|
18
|
+
attr_reader :base_url
|
19
|
+
|
24
20
|
def establish!
|
25
21
|
@resource = Faraday.new(base_url) do |builder|
|
26
22
|
builder.request :json
|
@@ -31,11 +27,7 @@ module Google
|
|
31
27
|
end
|
32
28
|
|
33
29
|
def resource
|
34
|
-
@resource or
|
35
|
-
end
|
36
|
-
|
37
|
-
def base_url
|
38
|
-
@base_url or ""
|
30
|
+
@resource or establish!
|
39
31
|
end
|
40
32
|
end
|
41
33
|
end
|
data/lib/google-civic/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-civic-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Coding ZEAL
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-10-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|