buttercms-ruby 1.0.0 → 1.0.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 +2 -2
- data/VERSION +1 -1
- data/lib/buttercms/butter_resource.rb +8 -9
- data/lib/buttercms/hash_to_object.rb +1 -1
- data/lib/buttercms/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: 98a401f6d29a1881182829f46acb4fcf1893b092
|
4
|
+
data.tar.gz: e97c155be97d717e429edd21702075127257749d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d9790b7c65894ea62af94ad7c67d1bab90b33ed7729ade165e755aa834ea8dbe38bb8f1e7a0b9332c17fd5e02d210e1dbfac77c892b571072c2b8d6f3951d48
|
7
|
+
data.tar.gz: 8c5114b79dbcdfd093bbc9fa2a254bbffec2f2885ec14db7c04a669620e721923c26b3b3c7b69ee362e1aca45b640f8c4d9986dec56e42ccd91f3712fdedcef0
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ To setup your project, follow these steps:
|
|
7
7
|
1. Install using `gem install buttercms-ruby` or by adding to your `Gemfile`:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem 'buttercms-ruby', '~>1.0.
|
10
|
+
gem 'buttercms-ruby', '~>1.0.1'
|
11
11
|
```
|
12
12
|
|
13
13
|
2. Set your API token.
|
@@ -31,7 +31,7 @@ puts post.title
|
|
31
31
|
author = ButterCMS::Author.find("author-slug")
|
32
32
|
puts author.first_name
|
33
33
|
|
34
|
-
category = ButterCMS::Category.find("
|
34
|
+
category = ButterCMS::Category.find("category-slug")
|
35
35
|
puts category.name
|
36
36
|
|
37
37
|
rss_feed = ButterCMS::Feed.find(:rss)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
@@ -3,16 +3,15 @@ module ButterCMS
|
|
3
3
|
attr_reader :meta, :data
|
4
4
|
|
5
5
|
def initialize(json)
|
6
|
-
data = json["data"]
|
7
|
-
meta = json["meta"]
|
8
|
-
|
9
6
|
@json = json
|
10
|
-
@data = HashToObject.convert(data)
|
11
|
-
@meta = HashToObject.convert(meta) if meta
|
12
|
-
|
13
|
-
data.
|
14
|
-
|
15
|
-
|
7
|
+
@data = HashToObject.convert(json["data"])
|
8
|
+
@meta = HashToObject.convert(json["meta"]) if json["meta"]
|
9
|
+
|
10
|
+
if json["data"].is_a?(Hash)
|
11
|
+
json["data"].each do |key, value|
|
12
|
+
instance_variable_set("@#{key}", @data.send(key))
|
13
|
+
self.class.send(:attr_reader, key)
|
14
|
+
end
|
16
15
|
end
|
17
16
|
end
|
18
17
|
|
data/lib/buttercms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buttercms-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ButterCMS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|