Class: ServicePresenter

Inherits:
BasePresenter show all
Defined in:
app/presenters/service_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(service) ⇒ ServicePresenter

Returns a new instance of ServicePresenter.


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

def initialize(service)
  @service = service
end

Dynamic Method Handling

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

Instance Method Details

#as_jsonObject


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

def as_json
  {
    :provider => @service.provider
  }
end

#to_json(options = {}) ⇒ Object


14
15
16
# File 'app/presenters/service_presenter.rb', line 14

def to_json(options = {})
  as_json.to_json(options)
end