Sha256: 93a4ffe8a01c78ca297e089925ae35c45f8d51bd78e445ec0e42b463aa744b7a
Contents?: true
Size: 699 Bytes
Versions: 1
Compression:
Stored size: 699 Bytes
Contents
class TumblrWrapper::Response attr_reader :status, :meta def initialize(faraday_response) @faraday_response = faraday_response @status = faraday_response.status @response = faraday_response.body["response"] parse_meta end private def faraday_response @faraday_response end def response @response end def parse_meta resp = faraday_response.body["meta"] || {} @meta = resp.respond_to?(:keys) ? resp.with_indifferent_access : resp end def method_missing(meth, *args, &block) if response.keys.include?(meth.to_s) r = response[meth.to_s] r.respond_to?(:keys) ? r.with_indifferent_access : r else super end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tumblr_wrapper-0.3.3 | lib/tumblr_wrapper/response.rb |