Class: AspectMembershipPresenter

Inherits:
BasePresenter show all
Defined in:
app/presenters/aspect_membership_presenter.rb

Instance Attribute Summary

Attributes inherited from BasePresenter

#current_user

Instance Method Summary collapse

Methods inherited from BasePresenter

as_collection, #method_missing, new

Constructor Details

#initialize(membership) ⇒ AspectMembershipPresenter

Returns a new instance of AspectMembershipPresenter.


4
5
6
# File 'app/presenters/aspect_membership_presenter.rb', line 4

def initialize(membership)
  @membership = membership
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BasePresenter

Instance Method Details

#base_hashObject


8
9
10
11
12
13
# File 'app/presenters/aspect_membership_presenter.rb', line 8

def base_hash
  {
    id:     @membership.id,
    aspect: AspectPresenter.new(@membership.aspect).as_json,
  }
end