Class: Pres::Presenter
- Inherits:
-
Object
- Object
- Pres::Presenter
- Includes:
- Presents, ViewDelegation
- Defined in:
- lib/pres/presenter.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(object, view_context = nil, options = {}) ⇒ Presenter
constructor
A new instance of Presenter.
- #inspect ⇒ Object
- #to_partial_path ⇒ Object
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.
12 13 14 15 16 |
# File 'lib/pres/presenter.rb', line 12 def initialize(object, view_context = nil, = {}) @object = object @view_context = view_context @options = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Pres::ViewDelegation
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
10 11 12 |
# File 'lib/pres/presenter.rb', line 10 def object @object end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/pres/presenter.rb', line 10 def @options end |
Instance Method Details
#id ⇒ Object
18 19 20 |
# File 'lib/pres/presenter.rb', line 18 def id object.id end |
#inspect ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/pres/presenter.rb', line 26 def inspect [ object.inspect, "options: #{.inspect}", "view_context: #{view_context.class.name}" ].join("\n") end |
#to_partial_path ⇒ Object
22 23 24 |
# File 'lib/pres/presenter.rb', line 22 def to_partial_path object.to_partial_path end |