class Grape::Formatter::Axlsx

Attributes

endpoint[R]
env[R]
object[R]

Public Class Methods

call(object, env) click to toggle source
# File lib/grape/formatter/axlsx.rb, line 6
def self.call(object, env)
  new(object, env).call
end
new(object, env) click to toggle source
# File lib/grape/formatter/axlsx.rb, line 10
def initialize(object, env)
  @object, @env = object, env
  @endpoint     = env['api.endpoint']
end

Public Instance Methods

call() click to toggle source
# File lib/grape/formatter/axlsx.rb, line 15
def call
  Grape::Axlsx::Renderer.new(env['api.tilt.root'], template).render(endpoint)
end

Private Instance Methods

template() click to toggle source
# File lib/grape/formatter/axlsx.rb, line 21
def template
  endpoint.options.fetch(:route_options, {})[:axlsx]
end