Class: JosebuilderGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/josebuilder/josebuilder_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_json_web_encriptionObject



26
27
28
29
30
31
32
# File 'lib/generators/josebuilder/josebuilder_generator.rb', line 26

def generate_json_web_encription
  ["index", "show"].each do |view|
    file = filename_with_directory('app/views', view)
    source = "encryption_" + filename_with_extensions(view)
    template source, file
  end if options.encryption?
end

#generate_json_web_signatureObject

class_option :combination, :type => :boolean, :default => false,

:description => "combine digital signature and encryption"


18
19
20
21
22
23
24
# File 'lib/generators/josebuilder/josebuilder_generator.rb', line 18

def generate_json_web_signature
  ["index", "show"].each do |view|
    file = filename_with_directory('app/views', view)
    source = "signature_" + filename_with_extensions(view)
    template source, file
  end if options.signature?
end