From: "Unix R." Date: 2013-06-10T23:35:48+09:00 Subject: Ruby Binding and send concepts Hi, i am struggling to understand binding concepts, i am not able to find good doc which can help me to understand or not able to find matching doc with the code i am looking at .. please help me to understand it with some examples ... https://github.com/Katello/runcible/blob/master/lib/runcible/resources/consumer.rb def self.create(id, optional={}) required = required_params(binding.send(:local_variables), binding) call(:post, path, :payload => { :required => required, :optional => optional }) end https://github.com/Katello/runcible/blob/master/lib/runcible/base.rb#L151 def self.required_params(local_names, binding, keys_to_remove=[]) local_names = local_names.reduce({}) do |acc, v| value = binding.eval(v.to_s) unless v == :_ acc[v] = value unless value.nil? acc end #The double delete is to support 1.8.7 and 1.9.3 local_names.delete(:payload) local_names.delete(:optional) local_names.delete("payload") local_names.delete("optional") keys_to_remove.each do |key| local_names.delete(key) local_names.delete(key.to_sym) end return local_names end .. How binding works in above example .. what i really want to understand is below method .. or some example i can relate with .. def self.required_params(local_names, binding, keys_to_remove=[]) local_names = local_names.reduce({}) do |acc, v| value = binding.eval(v.to_s) unless v == :_ acc[v] = value unless value.nil? acc end Regars, DJ -- Posted via http://www.ruby-forum.com/.