Class: Plotline::BasePresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/plotline/base_presenter.rb

Direct Known Subclasses

EntryPresenter

Instance Method Summary collapse

Constructor Details

#initialize(object, template) ⇒ BasePresenter

Returns a new instance of BasePresenter.



3
4
5
6
# File 'app/presenters/plotline/base_presenter.rb', line 3

def initialize(object, template)
  @object = object
  @template = template
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object (private)



20
21
22
23
24
25
26
27
# File 'app/presenters/plotline/base_presenter.rb', line 20

def method_missing(*args, &block)
  # this is probably too hacky
  if @object.respond_to?(args.first)
    @object.send(*args, &block)
  else
    @template.send(*args, &block)
  end
end