Class: BasePresenter

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

Direct Known Subclasses

ViewablePresenter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, context) ⇒ BasePresenter

Returns a new instance of BasePresenter.



6
7
8
# File 'app/presenters/base_presenter.rb', line 6

def initialize(model, context)
  @model, @context = model, context
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



10
11
12
# File 'app/presenters/base_presenter.rb', line 10

def method_missing(name, *args, &block)
  m.__send__(name, *args, &block)
end

Instance Attribute Details

#contextObject (readonly) Also known as: h

Returns the value of attribute context.



2
3
4
# File 'app/presenters/base_presenter.rb', line 2

def context
  @context
end

#modelObject (readonly) Also known as: m

Returns the value of attribute model.



2
3
4
# File 'app/presenters/base_presenter.rb', line 2

def model
  @model
end

Instance Method Details

#respond_to?(name, include_all = false) ⇒ Boolean

Returns:

  • (Boolean)


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

def respond_to?(name, include_all = false)
  super || m.respond_to?(name, include_all)
end