Commit 988fe3eda702d9285ca6d04891750611e289f178

Authored by Alessandro Palmeira + Diego Araújo
Committed by Paulo Meireles
1 parent 7f0c3e71

[Mezuro] Commented Model.rb to clarify to_hash usage

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
plugins/mezuro/lib/kalibro/model.rb
@@ -4,7 +4,7 @@ class Kalibro::Model @@ -4,7 +4,7 @@ class Kalibro::Model
4 attributes.each { |field, value| send("#{field}=", value) if self.class.is_valid?(field) } 4 attributes.each { |field, value| send("#{field}=", value) if self.class.is_valid?(field) }
5 end 5 end
6 6
7 - def to_hash 7 + def to_hash # Convert an object into a hash
8 hash = Hash.new 8 hash = Hash.new
9 fields.each do |field| 9 fields.each do |field|
10 field_value = send(field) 10 field_value = send(field)
@@ -48,7 +48,7 @@ class Kalibro::Model @@ -48,7 +48,7 @@ class Kalibro::Model
48 48
49 def self.request(endpoint, action, request_body = nil) 49 def self.request(endpoint, action, request_body = nil)
50 response = client(endpoint).request(:kalibro, action) { soap.body = request_body } 50 response = client(endpoint).request(:kalibro, action) { soap.body = request_body }
51 - response.to_hash["#{action}_response".to_sym] 51 + response.to_hash["#{action}_response".to_sym] # response is a Savon::SOAP::Response, and to_hash is a Savon::SOAP::Response method
52 end 52 end
53 53
54 def self.is_valid?(field) 54 def self.is_valid?(field)