./lib/animoto/response_parsers/yajl_adapter.rb in animoto-0.0.0.alpha9 vs ./lib/animoto/response_parsers/yajl_adapter.rb in animoto-0.1.0.beta0
- old
+ new
@@ -1,20 +1,21 @@
require 'yajl'
module Animoto
- class ResponseParser
- class YajlAdapter < Animoto::ResponseParser
+ module ResponseParsers
+ class YajlAdapter < Animoto::ResponseParsers::Base
@format = 'json'
- def parse body
- ::Yajl::Parser.parse body
+ # @return [Hash<String,Object>]
+ def parse string
+ ::Yajl::Parser.parse string
end
- def unparse hash
- ::Yajl::Encoder.encode hash
- end
-
+ # @return [String]
+ def unparse object
+ ::Yajl::Encoder.encode object
+ end
end
adapter_map.merge! :yajl => YajlAdapter
end
end
\ No newline at end of file