Module: Xhive::Presentable

Included in:
AnonymousUser, Page, Stylesheet
Defined in:
lib/xhive/presentable.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



24
25
26
# File 'lib/xhive/presentable.rb', line 24

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#presenterObject



3
4
5
6
# File 'lib/xhive/presentable.rb', line 3

def presenter
  klass = presenter_class.constantize
  klass.new(self)
end

#presenter_classObject



8
9
10
# File 'lib/xhive/presentable.rb', line 8

def presenter_class
  self.class.klass_name || "#{self.class.name}Presenter"
end