Guest User

Untitled

a guest
Apr 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <def tag="js-wrapper" attrs="convert">
  2. <set-scoped vals="&[]">
  3. <do param="default" />
  4. <% if convert %>
  5. <%= "[#{scope.vals.*.inspect.join(', ')}]" %>
  6. <% else %>
  7. <% scope.retval = scope.vals %>
  8. <% end %>
  9. </set-scoped>
  10. </def>
  11.  
  12. <def tag="hash-param" attrs="key">
  13. <set-scoped retval="">
  14. <% value = parameters.default %>
  15. <% value = scope.retval if value.blank? %>
  16. <% scope.vals << Hash[key, value] %>
  17. </set-scoped>
  18. </def>
  19.  
  20. <def tag="array-param">
  21. <set-scoped retval="">
  22. <% value = parameters.default %>
  23. <% value = scope.retval if value.blank? %>
  24. <% scope.vals << value %>
  25. </set-scoped>
  26. </def>
Add Comment
Please, Sign In to add comment