Class: Rspec::Generators::TransactionGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Rspec::Generators::TransactionGenerator
- Defined in:
- lib/generators/rspec/transaction_generator.rb
Instance Method Summary collapse
- #class_name ⇒ Object
- #create_transaction_spec ⇒ Object
- #factory_name ⇒ Object
- #file_name ⇒ Object
- #module_name ⇒ Object
- #module_path ⇒ Object
- #qualified_class_name ⇒ Object
Instance Method Details
#class_name ⇒ Object
22 23 24 |
# File 'lib/generators/rspec/transaction_generator.rb', line 22 def class_name "#{name.to_s.classify.chomp('Transaction')}Transaction" end |
#create_transaction_spec ⇒ Object
10 11 12 |
# File 'lib/generators/rspec/transaction_generator.rb', line 10 def create_transaction_spec template 'transaction_spec.rb.erb', "spec/models/#{module_path}/#{file_name}.rb" end |
#factory_name ⇒ Object
34 35 36 |
# File 'lib/generators/rspec/transaction_generator.rb', line 34 def factory_name class_name.underscore end |
#file_name ⇒ Object
14 15 16 |
# File 'lib/generators/rspec/transaction_generator.rb', line 14 def file_name "#{class_name.underscore}_spec" end |
#module_name ⇒ Object
26 27 28 |
# File 'lib/generators/rspec/transaction_generator.rb', line 26 def module_name module_path.classify end |
#module_path ⇒ Object
30 31 32 |
# File 'lib/generators/rspec/transaction_generator.rb', line 30 def module_path 'ledger' end |
#qualified_class_name ⇒ Object
18 19 20 |
# File 'lib/generators/rspec/transaction_generator.rb', line 18 def qualified_class_name "#{module_name}::#{class_name}" end |