Sha256: 0f41b8dc98ad53e369b700e752e9dcc172f40bf786547b08ad0ed138a5907010
Contents?: true
Size: 804 Bytes
Versions: 11
Compression:
Stored size: 804 Bytes
Contents
# frozen_string_literal: true require 'zoho_hub/records/base_record' module ZohoHub class Quote < BaseRecord attributes :id, :stage, :subject attributes :potential_id attribute_translation( id: :id, stage: :Quote_Stage ) def initialize(params) puts Rainbow(params).bright.red attributes.each do |attr| zoho_key = attr_to_zoho_key(attr) send("#{attr}=", params[zoho_key] || params[attr]) end @potential_id ||= params.dig(:Deal_Name, :id) @lender_organisation_id ||= params.dig(:Account_Name, :id) end def to_params params = super params[:Deal_Name] = { id: @potential_id } if @potential_id params[:Account_Name] = { id: @lender_organisation_id } if @lender_organisation_id end end end
Version data entries
11 entries across 11 versions & 1 rubygems