Module: ModelPresenter::Base

Defined in:
lib/model_presenter/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(mod) ⇒ Object


12
13
14
15
16
17
# File 'lib/model_presenter/base.rb', line 12

def self.included(mod)
  mod.extend ForwardFromModel
  mod.extend AsJson
  mod.extend Moneyize
  mod.extend HasMany
end

Instance Method Details

#initialize(model) ⇒ Object


19
20
21
# File 'lib/model_presenter/base.rb', line 19

def initialize(model)
  @model = model
end

#to_json(options = {}) ⇒ Object


23
24
25
# File 'lib/model_presenter/base.rb', line 23

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