From 988fe3eda702d9285ca6d04891750611e289f178 Mon Sep 17 00:00:00 2001 From: Alessandro Palmeira + Diego Araújo Date: Fri, 13 Jul 2012 11:08:21 -0300 Subject: [PATCH] [Mezuro] Commented Model.rb to clarify to_hash usage --- plugins/mezuro/lib/kalibro/model.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mezuro/lib/kalibro/model.rb b/plugins/mezuro/lib/kalibro/model.rb index bd8b0c5..7b331a7 100644 --- a/plugins/mezuro/lib/kalibro/model.rb +++ b/plugins/mezuro/lib/kalibro/model.rb @@ -4,7 +4,7 @@ class Kalibro::Model attributes.each { |field, value| send("#{field}=", value) if self.class.is_valid?(field) } end - def to_hash + def to_hash # Convert an object into a hash hash = Hash.new fields.each do |field| field_value = send(field) @@ -48,7 +48,7 @@ class Kalibro::Model def self.request(endpoint, action, request_body = nil) response = client(endpoint).request(:kalibro, action) { soap.body = request_body } - response.to_hash["#{action}_response".to_sym] + response.to_hash["#{action}_response".to_sym] # response is a Savon::SOAP::Response, and to_hash is a Savon::SOAP::Response method end def self.is_valid?(field) -- libgit2 0.21.2