Module: Intercom::Lib::DynamicAccessors

Defined in:
lib/intercom/lib/dynamic_accessors.rb

Class Method Summary collapse

Class Method Details

.define_accessors(attribute, value, object) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/intercom/lib/dynamic_accessors.rb', line 7

def define_accessors(attribute, value, object)
  if attribute.to_s.end_with?('_at') && attribute.to_s != 'update_last_request_at'
    define_date_based_accessors(attribute, value, object)
  elsif object.flat_store_attribute?(attribute)
    define_flat_store_based_accessors(attribute, value, object)
  else
    define_standard_accessors(attribute, value, object)
  end
end