Class: RideTheStreetcar::Apply
- Inherits:
-
Object
- Object
- RideTheStreetcar::Apply
- Includes:
- Streamlined::Renderable
- Defined in:
- lib/ride_the_streetcar/apply.rb
Instance Method Summary collapse
-
#initialize(method_chain, *args) ⇒ Apply
constructor
A new instance of Apply.
- #template ⇒ Object
Constructor Details
#initialize(method_chain, *args) ⇒ Apply
Returns a new instance of Apply.
5 6 7 8 |
# File 'lib/ride_the_streetcar/apply.rb', line 5 def initialize(method_chain, *args) @method_chain = method_chain @args = args end |
Instance Method Details
#template ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/ride_the_streetcar/apply.rb', line 10 def template attributes = { method: @method_chain } attributes[:args] = @args.to_json unless @args.empty? html -> { <<~HTML <sc-apply #{html_attributes attributes}></sc-apply> HTML } end |