Module: Vodka::Server::Plugins::Presentable

Extended by:
ActiveSupport::Concern
Defined in:
lib/vodka/server/plugins/presentable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#presentObject



7
8
9
10
11
12
13
14
# File 'lib/vodka/server/plugins/presentable.rb', line 7

def present
  presenter_class = if self.class.class_variable_defined?(:@@presenter)
    self.class.class_variable_get(:@@presenter)
  else
    Object.const_get(:"#{self.class.name}Presenter")
  end
  presenter_class.new(self).present
end