Class: Pres::Presenter

Inherits:
Object
  • Object
show all
Includes:
Presents, ViewDelegation
Defined in:
lib/pres/presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ViewDelegation

#method_missing, #respond_to_missing?, #view_context

Constructor Details

#initialize(object, view_context = nil, options = {}) ⇒ Presenter

Returns a new instance of Presenter.



10
11
12
13
14
# File 'lib/pres/presenter.rb', line 10

def initialize(object, view_context = nil, options = {})
  @object = object
  @view_context = view_context
  @options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Pres::ViewDelegation

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



8
9
10
# File 'lib/pres/presenter.rb', line 8

def object
  @object
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/pres/presenter.rb', line 8

def options
  @options
end

Instance Method Details

#idObject



16
17
18
# File 'lib/pres/presenter.rb', line 16

def id
  object.id
end

#to_partial_pathObject



20
21
22
# File 'lib/pres/presenter.rb', line 20

def to_partial_path
  object.to_partial_path
end