Class: Phlex::Rails::Partial
- Inherits:
-
Object
- Object
- Phlex::Rails::Partial
- Defined in:
- lib/phlex/rails/partial.rb
Instance Method Summary collapse
-
#initialize(path, *args, **kwargs, &block) ⇒ Partial
constructor
A new instance of Partial.
- #render_in(view_context, &block) ⇒ Object
Constructor Details
#initialize(path, *args, **kwargs, &block) ⇒ Partial
Returns a new instance of Partial.
4 5 6 7 8 9 |
# File 'lib/phlex/rails/partial.rb', line 4 def initialize(path, *args, **kwargs, &block) @path = path @args = args @kwargs = kwargs @block = block end |
Instance Method Details
#render_in(view_context, &block) ⇒ Object
11 12 13 14 |
# File 'lib/phlex/rails/partial.rb', line 11 def render_in(view_context, &block) block ||= @block view_context.render(@path, *@args, **@kwargs, &block) end |