lib/geonames_api/entity.rb in geonames_api-0.1.4 vs lib/geonames_api/entity.rb in geonames_api-0.1.5

- old
+ new

@@ -7,12 +7,19 @@ def_delegator :geonames, :each alias_method :size, :count attr_reader :request_params def initialize(response, request_params = nil) - @response = response - @request_params = request_params + marshal_load([response, request_params]) + end + + def marshal_load(x) + @response, @request_params = x parse_response + end + + def marshal_dump + [@response, @request_params] end def parse_response @response.keys.each { |ea| parse_attr(ea) } end