Class: Gaskit::Generators::QueryGenerator

Inherits:
OperationGenerator
  • Object
show all
Defined in:
lib/generators/gaskit/operation/query_generator.rb

Overview

A Rails generator for creating new service classes that inherit from ‘Gaskit::Query`.

This generator supports namespaced queries and places them under ‘app/queries`.

Examples:

Generate a base operation

rails generate gaskit:query FetchUserQuery

See Also:

  • for the ERB template used.

Constant Summary

Constants inherited from OperationGenerator

OperationGenerator::SUPPORTED_TYPES

Instance Method Summary collapse

Methods inherited from OperationGenerator

#create_operation_file, #validate_type!

Constructor Details

#initialize(*args) ⇒ QueryGenerator

Returns a new instance of QueryGenerator.



16
17
18
19
# File 'lib/generators/gaskit/operation/query_generator.rb', line 16

def initialize(*args)
  super
  options[:type] = "query"
end