Class: JsonSchemaView::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/json_schema_view/rails/generators/install/install_generator.rb

Overview

Install files to setup json_schema_view gem.

Instance Method Summary collapse

Instance Method Details

#create_base_classesObject



19
20
21
22
23
# File 'lib/json_schema_view/rails/generators/install/install_generator.rb', line 19

def create_base_classes
  template "base_component.rb", File.join(components_path, "base_component.rb")
  template "base_props.rb", File.join(components_path, "base_props.rb")
  template "component_schema_set.rb", File.join(components_path, "component_schema_set.rb")
end

#create_exmaplesObject



25
26
27
28
29
# File 'lib/json_schema_view/rails/generators/install/install_generator.rb', line 25

def create_exmaples
  template "example/todo_list_component.rb", File.join(components_path, "example_todo_list_component.rb")
  template "example/todo_item_resource.rb",
           File.join(components_path, "example_todo_list_component", "todo_item_resource.rb")
end

#create_initializerObject



15
16
17
# File 'lib/json_schema_view/rails/generators/install/install_generator.rb', line 15

def create_initializer
  template "initializer.rb", "config/initializers/json_schema_view.rb"
end