Class: Makit::Cli::Generators::Templates::Ruby::MainLib
- Inherits:
-
Object
- Object
- Makit::Cli::Generators::Templates::Ruby::MainLib
- Defined in:
- lib/makit/cli/generators/templates/ruby/main_lib.rb
Overview
Template for main Ruby gem lib file
Instance Method Summary collapse
-
#initialize(project_name) ⇒ MainLib
constructor
A new instance of MainLib.
- #render ⇒ Object
Constructor Details
#initialize(project_name) ⇒ MainLib
Returns a new instance of MainLib.
10 11 12 13 |
# File 'lib/makit/cli/generators/templates/ruby/main_lib.rb', line 10 def initialize(project_name) @project_name = project_name @module_name = project_name.split(/[-_]/).map(&:capitalize).join end |
Instance Method Details
#render ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/makit/cli/generators/templates/ruby/main_lib.rb', line 15 def render <<~RUBY # frozen_string_literal: true require_relative "#{@project_name}/version" module #{@module_name} class Error < StandardError; end #{" "} # Your code goes here... end RUBY end |