Class: Generalis::Generators::TransactionGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Generalis::Generators::TransactionGenerator
- Defined in:
- lib/generators/generalis/transaction_generator.rb
Instance Method Summary collapse
- #class_name ⇒ Object
- #create_transaction ⇒ Object
- #file_name ⇒ Object
- #module_name ⇒ Object
- #module_path ⇒ Object
Instance Method Details
#class_name ⇒ Object
18 19 20 |
# File 'lib/generators/generalis/transaction_generator.rb', line 18 def class_name "#{name.to_s.classify.chomp('Transaction')}Transaction" end |
#create_transaction ⇒ Object
10 11 12 |
# File 'lib/generators/generalis/transaction_generator.rb', line 10 def create_transaction template 'transaction.rb.erb', "app/models/#{module_path}/#{file_name}.rb" end |
#file_name ⇒ Object
14 15 16 |
# File 'lib/generators/generalis/transaction_generator.rb', line 14 def file_name class_name.underscore end |
#module_name ⇒ Object
22 23 24 |
# File 'lib/generators/generalis/transaction_generator.rb', line 22 def module_name module_path.classify end |
#module_path ⇒ Object
26 27 28 |
# File 'lib/generators/generalis/transaction_generator.rb', line 26 def module_path 'ledger' end |