Sha256: 8310b4607c0fafaeec09c57dbf6fd48bdd06994aa6d7c1a72f3ff3ea888df755
Contents?: true
Size: 650 Bytes
Versions: 10
Compression:
Stored size: 650 Bytes
Contents
require "pbbuilder/template" # Basically copied and pasted from JbuilderHandler, except it uses Pbbuilder class PbbuilderHandler # This builds up a Ruby string, that Rails' templating system `eval`s to create the view result. # In our case the view result is a Protobuf message. def self.call(template, source = nil) source ||= template.source # We need to keep `source` on the first line, so line numbers are correct if there's an error %{__already_defined = defined?(pb); pb ||= PbbuilderTemplate.new(self, @_response_class.new); #{source} pb.target! unless (__already_defined && __already_defined != "method")} end end
Version data entries
10 entries across 10 versions & 1 rubygems