Class: Grape::Formatter::Axlsx

Inherits:
Object
  • Object
show all
Defined in:
lib/grape/formatter/axlsx.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, env) ⇒ Axlsx

Returns a new instance of Axlsx.



10
11
12
13
# File 'lib/grape/formatter/axlsx.rb', line 10

def initialize(object, env)
  @object, @env = object, env
  @endpoint     = env['api.endpoint']
end

Instance Attribute Details

#endpointObject (readonly)

Returns the value of attribute endpoint.



4
5
6
# File 'lib/grape/formatter/axlsx.rb', line 4

def endpoint
  @endpoint
end

#envObject (readonly)

Returns the value of attribute env.



4
5
6
# File 'lib/grape/formatter/axlsx.rb', line 4

def env
  @env
end

#objectObject (readonly)

Returns the value of attribute object.



4
5
6
# File 'lib/grape/formatter/axlsx.rb', line 4

def object
  @object
end

Class Method Details

.call(object, env) ⇒ Object



6
7
8
# File 'lib/grape/formatter/axlsx.rb', line 6

def self.call(object, env)
  new(object, env).call
end

Instance Method Details

#callObject



15
16
17
# File 'lib/grape/formatter/axlsx.rb', line 15

def call
  Grape::Axlsx::Renderer.new(env['api.tilt.root'], template).render(endpoint)
end