Module: ActsAsPresentable::ClassMethods

Defined in:
lib/acts_as_presentable.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_presentable(options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/acts_as_presentable.rb', line 11

def acts_as_presentable(options = {})
  unless presentable?
    def presenter_class
      self.class.name + 'Presenter'
    end
    def presenter_key
      self.class.name.underscore.downcase + '_presenter'.to_sym
    end
  end
  include InstanceMethods
end

#presentable?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/acts_as_presentable.rb', line 22

def presentable?
  self.included_modules.include?(InstanceMethods)
end