tumblr_wrapper 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -79,13 +79,13 @@ To delete a post:
79
79
  post.delete({id: "ID FROM TUMBLR"})
80
80
 
81
81
  The response object is a TumblrWrapper::Response.
82
- It responds to `:status`, `:meta`, and any of the keys under "response" from tumblr.
82
+ It responds to `:status`, `:message`, and any of the keys under "response" from tumblr.
83
83
  Any of the values which are hashes will have indifferent access.
84
84
  For example,
85
85
 
86
86
  response = blog.posts
87
87
  response.status.should == 200
88
- response.meta[:status].should == 200
88
+ response.message.should == "OK"
89
89
  response.blog[:title].should == "Your Blog Title"
90
90
  response.posts.should be_a(Array)
91
91
 
@@ -1,10 +1,10 @@
1
1
  class TumblrWrapper::Response
2
- attr_reader :status, :meta
2
+ attr_reader :status, :message
3
3
  def initialize(faraday_response)
4
4
  @faraday_response = faraday_response
5
5
  @status = faraday_response.status
6
6
  @response = faraday_response.body["response"]
7
- parse_meta
7
+ parse_message
8
8
  end
9
9
 
10
10
  private
@@ -16,9 +16,9 @@ class TumblrWrapper::Response
16
16
  @response
17
17
  end
18
18
 
19
- def parse_meta
19
+ def parse_message
20
20
  resp = faraday_response.body["meta"] || {}
21
- @meta = resp.respond_to?(:keys) ? resp.with_indifferent_access : resp
21
+ @message = resp.respond_to?(:keys) ? resp['msg'] : nil
22
22
  end
23
23
 
24
24
  def method_missing(meth, *args, &block)
@@ -1,3 +1,3 @@
1
1
  module TumblrWrapper
2
- VERSION = "0.3.4"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -37,9 +37,7 @@ describe TumblrWrapper, type: :integration do
37
37
  response.should be_a(TumblrWrapper::Response)
38
38
  response.status.should == 200
39
39
 
40
- response.meta[:msg].should == "OK"
41
- response.meta[:status].should == 200
42
-
40
+ response.message.should == "OK"
43
41
  response.blog[:title].should == blog_title
44
42
  end
45
43
  end
@@ -62,8 +60,7 @@ describe TumblrWrapper, type: :integration do
62
60
  blog_resource = TumblrWrapper::Blog.new(blogname, token)
63
61
  response = blog_resource.posts
64
62
  response.status.should == 200
65
-
66
- response.meta.should be_present
63
+ response.message.should == "OK"
67
64
  response.blog.should be_present
68
65
  response.posts.should be_present
69
66
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 3
8
7
  - 4
9
- version: 0.3.4
8
+ - 0
9
+ version: 0.4.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - rheaton