Class: DelegatePresenter::Base
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- DelegatePresenter::Base
- Defined in:
- lib/delegate_presenter.rb
Instance Method Summary collapse
- #h(str) ⇒ Object
- #helpers ⇒ Object
-
#initialize(object_to_delegate_to) ⇒ Base
constructor
A new instance of Base.
- #record_id ⇒ Object
- #s(*args) ⇒ Object
Constructor Details
#initialize(object_to_delegate_to) ⇒ Base
Returns a new instance of Base.
10 11 12 |
# File 'lib/delegate_presenter.rb', line 10 def initialize( object_to_delegate_to ) super(object_to_delegate_to) end |
Instance Method Details
#h(str) ⇒ Object
32 33 34 |
# File 'lib/delegate_presenter.rb', line 32 def h(str) helpers.send(:h, str) end |
#helpers ⇒ Object
20 21 22 |
# File 'lib/delegate_presenter.rb', line 20 def helpers ::ApplicationController.all_helpers # the GLOBAL ApplicationController, not the ApplicationController in this namespace end |
#record_id ⇒ Object
15 16 17 |
# File 'lib/delegate_presenter.rb', line 15 def record_id self.__getobj__.id end |
#s(*args) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/delegate_presenter.rb', line 24 def s(*args) output = "".html_safe args.each {|current_arg| output << current_arg.html_safe } output end |