Class: Spotlight::Engine::TranslationYamlHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/spotlight/engine.rb

Overview

Copy of JbuilderHandler tweaked to spit out YAML for translation exports

Class Method Summary collapse

Class Method Details

.call(template, source = nil) ⇒ Object



240
241
242
243
244
245
# File 'lib/spotlight/engine.rb', line 240

def self.call(template, source = nil)
  source ||= template.source
  # this juggling is required to keep line numbers right in the error
  %{__already_defined = defined?(json); json||=JbuilderTemplate.new(self); #{source}
    json.attributes!.to_yaml unless (__already_defined && __already_defined != "method")}
end