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
16
# File 'lib/intercom/lib/dynamic_accessors.rb', line 7

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