Class: Kublog::PostFormPresenter
- Inherits:
-
Object
- Object
- Kublog::PostFormPresenter
- Defined in:
- app/presenters/kublog/post_form_presenter.rb
Instance Attribute Summary collapse
-
#notifications ⇒ Object
Returns the value of attribute notifications.
-
#post ⇒ Object
Returns the value of attribute post.
Instance Method Summary collapse
-
#initialize(post) ⇒ PostFormPresenter
constructor
A new instance of PostFormPresenter.
- #notification(kind) ⇒ Object
Constructor Details
#initialize(post) ⇒ PostFormPresenter
Returns a new instance of PostFormPresenter.
6 7 8 9 10 11 12 |
# File 'app/presenters/kublog/post_form_presenter.rb', line 6 def initialize(post) @post = post @notifications = [] @notifications << notification('twitter') if Kublog.twitter? @notifications << notification('facebook') if Kublog.facebook? @notifications << notification('email') if Kublog.email? end |
Instance Attribute Details
#notifications ⇒ Object
Returns the value of attribute notifications.
4 5 6 |
# File 'app/presenters/kublog/post_form_presenter.rb', line 4 def notifications @notifications end |
#post ⇒ Object
Returns the value of attribute post.
4 5 6 |
# File 'app/presenters/kublog/post_form_presenter.rb', line 4 def post @post end |
Instance Method Details
#notification(kind) ⇒ Object
14 15 16 |
# File 'app/presenters/kublog/post_form_presenter.rb', line 14 def notification(kind) @post.notifications.build(:kind => kind, :post => @post) end |