Sha256: 4dac83dcf8a0b0d859be5809981922d21af2a35857bc06359c7c87e0380edd23
Contents?: true
Size: 644 Bytes
Versions: 13
Compression:
Stored size: 644 Bytes
Contents
module ActiveForce class Field attr_accessor :local_name, :sfdc_name, :as def initialize name, options = {} self.local_name = name self.sfdc_name = options[:sfdc_name] || options[:from] || default_api_name self.as = options[:as] || :string end def value_for_hash value case as when :datetime value&.to_fs(:iso8601) else value end end private ### # Transforms +attribute+ to the conventional Salesforce API name. # def default_api_name local_name.to_s.split('_').map(&:capitalize).join('_') << '__c' end end end
Version data entries
13 entries across 13 versions & 1 rubygems