Sha256: 194405e566664c80b4c432ecc6423e5882c8f38f3a22c6c0f2bbf4ad096b2977
Contents?: true
Size: 963 Bytes
Versions: 6
Compression:
Stored size: 963 Bytes
Contents
<%- assert_locals resource -%> ## # Create a fully-qualified <%= resource.name %> resource string. # <%- resource.patterns.each do |pattern| -%> # @overload <%= resource.path_helper %>(<%= pattern.formal_arguments %>) <%= indent render(partial: "service/client/resource/doc", locals: { pattern: pattern }), "# " %> # <%- end -%> # @return [::String] def <%= resource.path_helper %> **args resources = { <%- last_pattern_index = resource.patterns.count - 1 -%> <%- resource.patterns.each_with_index do |pattern, index| -%> <%- comma = last_pattern_index == index ? "" : "," -%> <%= pattern.arguments_key.inspect %> => (proc do |<%= pattern.formal_arguments %>| <%= indent render(partial: "service/client/resource/def", locals: { pattern: pattern }), 6 %> end)<%= comma %> <%- end -%> } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end
Version data entries
6 entries across 6 versions & 1 rubygems