lib/her/api.rb in her-0.1 vs lib/her/api.rb in her-0.1.1
- old
+ new
@@ -24,11 +24,11 @@
def setup(attrs={}) # {{{
@base_uri = attrs[:base_uri]
@parse_with = lambda do |response|
json = JSON.parse(response.body, :symbolize_names => true)
{
- :resource => json[:data],
+ :data => json[:data],
:errors => json[:errors],
:metadata => json[:metadata],
}
end
@connection = Faraday.new(:url => @base_uri) do |builder|
@@ -36,10 +36,10 @@
builder.adapter :net_http
end
end # }}}
# Define a custom parsing procedure. The procedure is passed the response object and is
- # expected to return a hash with three keys: a main resource Hash, an errors Array
+ # expected to return a hash with three keys: a main data Hash, an errors Array
# and a metadata Hash.
#
# @example
# $my_api.parse_with do |response|
# json = JSON.parse(response.body)