Module: PecCalcClient::RequestObject
Overview
Methods for request instance
Instance Method Summary collapse
Instance Method Details
#init_params(params) ⇒ Object
17 18 19 20 21 |
# File 'lib/pec_calc_client.rb', line 17 def init_params(params) params.each do |k, v| instance_variable_set("@#{k}", v) if self.class::PARAMS.include?(k.to_s) end end |
#to_h ⇒ Object
23 24 25 |
# File 'lib/pec_calc_client.rb', line 23 def to_h self.class::PARAMS.map { |k| [k, instance_variable_get("@#{k}")] }.to_h end |