Class: Shoehorn::HelperMethodCall
- Inherits:
-
Object
- Object
- Shoehorn::HelperMethodCall
- Defined in:
- lib/shoehorn/helper_collection.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#method ⇒ Object
Returns the value of attribute method.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(view, symbol, args, block) ⇒ HelperMethodCall
constructor
A new instance of HelperMethodCall.
- #to_s ⇒ Object
Constructor Details
#initialize(view, symbol, args, block) ⇒ HelperMethodCall
Returns a new instance of HelperMethodCall.
36 37 38 39 40 41 42 |
# File 'lib/shoehorn/helper_collection.rb', line 36 def initialize(view, symbol, args, block) @view = view @method = symbol @options = args. @args = args @block = block end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
34 35 36 |
# File 'lib/shoehorn/helper_collection.rb', line 34 def args @args end |
#method ⇒ Object
Returns the value of attribute method.
34 35 36 |
# File 'lib/shoehorn/helper_collection.rb', line 34 def method @method end |
#options ⇒ Object
Returns the value of attribute options.
34 35 36 |
# File 'lib/shoehorn/helper_collection.rb', line 34 def @options end |
Instance Method Details
#to_s ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/shoehorn/helper_collection.rb', line 44 def to_s args = @args args << @options if @block output = @view.send(@method, *args, &@block) else output = @view.send(@method, *args) end output.blank? ? nil : output.html_safe end |