module RailsTwirp::RenderPb

RenderPb makes it possible to do 'render pb: <proto object>', skipping templates The way this module is written is inspired by ActionController::Renderers

Public Instance Methods

_render_to_body_with_pb(options) click to toggle source
# File lib/rails_twirp/render_pb.rb, line 9
def _render_to_body_with_pb(options)
  if options.include? :pb
    _process_options(options)
    return options[:pb]
  end

  nil
end
render_to_body(options) click to toggle source
Calls superclass method
# File lib/rails_twirp/render_pb.rb, line 5
def render_to_body(options)
  _render_to_body_with_pb(options) || super
end