lib/dto/posting/exists_response.rb in threetaps-client-1.0.2 vs lib/dto/posting/exists_response.rb in threetaps-client-1.0.3

- old
+ new

@@ -5,12 +5,12 @@ # with attribute +success+ accessible via getter: # # response = ExistsResponse.from_hash("success" => "true") # response.success # => true # -class ExistsResponse - attr_accessor :exists, :postKey, :error - - def self.from_array(json) - json +class ExistsResponse < Struct.new(:indexed, :postKey, :exists, :failures) + def initialize(hash = {}) + hash.each do |key, value| + self.send("#{key}=".to_sym, value ) + end end end