module ZohoHub::WithAttributes::ClassMethods
Public Instance Methods
attr_to_zoho_key(attr_name)
click to toggle source
# File lib/zoho_hub/with_attributes.rb, line 46 def attr_to_zoho_key(attr_name) if attribute_translation.key?(attr_name.to_sym) return attribute_translation[attr_name.to_sym] end attr_name.to_s.split('_').map(&:capitalize).join('_').to_sym end
attribute_translation(translation = nil)
click to toggle source
# File lib/zoho_hub/with_attributes.rb, line 38 def attribute_translation(translation = nil) @attribute_translation ||= {} return @attribute_translation unless translation @attribute_translation = translation end
attributes(*attributes)
click to toggle source
# File lib/zoho_hub/with_attributes.rb, line 28 def attributes(*attributes) @attributes ||= [] return @attributes unless attributes attr_accessor(*attributes) @attributes += attributes end
zoho_key_translation()
click to toggle source
# File lib/zoho_hub/with_attributes.rb, line 54 def zoho_key_translation @attribute_translation.to_a.map(&:rotate).to_h end