Class: UserSettingsPresenter
- Inherits:
-
Object
- Object
- UserSettingsPresenter
- Defined in:
- app/presenters/user_settings_presenter.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(resource) ⇒ UserSettingsPresenter
constructor
A new instance of UserSettingsPresenter.
Constructor Details
#initialize(resource) ⇒ UserSettingsPresenter
Returns a new instance of UserSettingsPresenter.
4 5 6 |
# File 'app/presenters/user_settings_presenter.rb', line 4 def initialize(resource) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
2 3 4 |
# File 'app/presenters/user_settings_presenter.rb', line 2 def resource @resource end |
Instance Method Details
#as_json ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'app/presenters/user_settings_presenter.rb', line 8 def as_json if @resource == false || @resource == true || @resource == nil { success: @resource || false } else { success: true, value: @resource } end end |