Module: Looksist::Core

Extended by:
ActiveSupport::Concern
Includes:
Common
Included in:
Looksist
Defined in:
lib/looksist/core.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from Common

#__entity__

Instance Method Details

#as_json(opts) ⇒ Object



49
50
51
52
53
54
55
56
# File 'lib/looksist/core.rb', line 49

def as_json(opts)
  parent_lookups = {}
  class_lookups = self.class.lookup_attributes || {}
  if self.class.superclass.respond_to?(:lookup_attributes)
    parent_lookups = self.class.superclass.lookup_attributes || {}
  end
  Looksist.driver.json_opts(self, class_lookups.merge(parent_lookups), opts)
end