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
- #humanized_slice_name ⇒ Object private
-
#initialize(inflector, app, slice, url) ⇒ 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_views?, #camelized_app_name, #ctx, #generate_assets?, #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) ⇒ 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.
14 15 16 17 18 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 14 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.
22 23 24 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 22 def camelized_slice_name inflector.camelize(slice) 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.
34 35 36 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 34 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.
46 47 48 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 46 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.
40 41 42 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 40 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.
28 29 30 |
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 28 def underscored_slice_name inflector.underscore(slice) end |