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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ee66524f2360ca52385c2b44fe98dea5a2c081e
4
- data.tar.gz: 7e6fa47faf2d296f20bc152e1abb2dd536b7a62d
3
+ metadata.gz: bee84ec2b2400c0f726712fcd324c9a30b6f1820
4
+ data.tar.gz: 46445c19ed1e2d0636261d613068c4b2e40ddda2
5
5
  SHA512:
6
- metadata.gz: 2dc06c70e8b06e0e580f6dd4819b1dc948135926bc020bc2041ed06300a49867a9baf6eb12f643016f08f63a01d6e6d1489f3f9c953ba43837284eb80f82c1d2
7
- data.tar.gz: c1af46a146bb53d83a160161db814e07a7cd077e06ebc1f15ae2b37278648277e55e1afd45602eca13a562d2367a0ca5ad257a1e338771e74df1c29bafab6f98
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
- def get(*args, &block)
15
- resource.get(*args, &block)
16
- end
9
+ attr_writer :base_url
17
10
 
18
- def post(*args, &block)
19
- resource.post(*args, &block)
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 raise "Connection not established"
35
- end
36
-
37
- def base_url
38
- @base_url or ""
30
+ @resource or establish!
39
31
  end
40
32
  end
41
33
  end
@@ -1,3 +1,5 @@
1
+ require 'ostruct'
2
+
1
3
  module Google
2
4
  module Civic
3
5
  class Representation < OpenStruct
@@ -1,5 +1,5 @@
1
1
  module Google
2
2
  module Civic
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
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.0
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-06-06 00:00:00.000000000 Z
12
+ date: 2014-10-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json