Class: Xhive::BasePresenter

Inherits:
Object
  • Object
show all
Includes:
ActionView::Context, ActionView::Helpers
Defined in:
app/presenters/xhive/base_presenter.rb

Direct Known Subclasses

PagePresenter, StylesheetPresenter, UserPresenter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ BasePresenter

Returns a new instance of BasePresenter.



12
13
14
# File 'app/presenters/xhive/base_presenter.rb', line 12

def initialize(object)
  @object = object
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



3
4
5
# File 'app/presenters/xhive/base_presenter.rb', line 3

def object
  @object
end

Instance Method Details

#idObject



16
17
18
# File 'app/presenters/xhive/base_presenter.rb', line 16

def id
  @object.id
end

#safe_userObject



20
21
22
# File 'app/presenters/xhive/base_presenter.rb', line 20

def safe_user
  controller.try(:safe_user).try(:presenter)
end