Class: Hanami::CLI::Generators::App::SliceContext Private
- Defined in:
- lib/hanami/cli/generators/app/slice_context.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
Instance Method Summary collapse
- #camelized_slice_name ⇒ Object private
- #generate_db? ⇒ Boolean private
- #generate_route? ⇒ Boolean private
- #humanized_slice_name ⇒ Object private
-
#initialize(inflector, app, slice, url, **options) ⇒ SliceContext
constructor
private
A new instance of SliceContext.
- #javascript_erb_tag ⇒ Object private
- #stylesheet_erb_tag ⇒ Object private
- #underscored_slice_name ⇒ Object private
Methods inherited from Context
#bundled_assets?, #bundled_dry_monads?, #bundled_views?, #camelized_app_name, #ctx, #database_url, #generate_assets?, #generate_mysql?, #generate_postgres?, #generate_sqlite?, #hanami_assets_npm_package, #hanami_gem, #hanami_gem_version, #hanami_head?, #humanized_app_name, #ruby_omit_hash_values?, #underscored_app_name
Constructor Details
#initialize(inflector, app, slice, url, **options) ⇒ SliceContext
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SliceContext.
15 16 17 18 19 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 15 def initialize(inflector, app, slice, url, **) @slice = slice @url = url super(inflector, app, **) end |
Instance Method Details
#camelized_slice_name ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 23 def camelized_slice_name inflector.camelize(slice) end |
#generate_db? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
53 54 55 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 53 def generate_db? !.fetch(:skip_db, false) end |
#generate_route? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
59 60 61 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 59 def generate_route? !.fetch(:skip_route, false) end |
#humanized_slice_name ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 35 def humanized_slice_name inflector.humanize(slice) end |
#javascript_erb_tag ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 47 def javascript_erb_tag %(<%= javascript_tag "app" %>) end |
#stylesheet_erb_tag ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 41 def stylesheet_erb_tag %(<%= stylesheet_tag "app" %>) end |
#underscored_slice_name ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 29 def underscored_slice_name inflector.underscore(slice) end |