Module: Garage::ResourceCastingResponder

Included in:
AppResponder
Defined in:
lib/garage/resource_casting_responder.rb

Instance Method Summary collapse

Instance Method Details

#display(resource, given_options = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/garage/resource_casting_responder.rb', line 7

def display(resource, given_options={})
  if @caster
    resource = @caster.call(resource, @options)
  end
  super(resource, given_options)
end

#initialize(*args) ⇒ Object



2
3
4
5
# File 'lib/garage/resource_casting_responder.rb', line 2

def initialize(*args)
  super
  @caster = Garage.configuration.cast_resource
end