Class: Hanami::CLI::Generators::App::SliceContext Private

Inherits:
Context
  • Object
show all
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.

Since:

  • 2.0.0

Direct Known Subclasses

ActionContext, PartContext, ViewContext

Instance Method Summary collapse

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.

Since:

  • 2.0.0



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_nameObject

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.

Since:

  • 2.0.0



22
23
24
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 22

def camelized_slice_name
  inflector.camelize(slice)
end

#humanized_slice_nameObject

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.

Since:

  • 2.1.0



34
35
36
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 34

def humanized_slice_name
  inflector.humanize(slice)
end

#javascript_erb_tagObject

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.

Since:

  • 2.1.0



46
47
48
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 46

def javascript_erb_tag
  %(<%= javascript_tag "app" %>)
end

#stylesheet_erb_tagObject

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.

Since:

  • 2.1.0



40
41
42
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 40

def stylesheet_erb_tag
  %(<%= stylesheet_tag "app" %>)
end

#underscored_slice_nameObject

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.

Since:

  • 2.0.0



28
29
30
# File 'lib/hanami/cli/generators/app/slice_context.rb', line 28

def underscored_slice_name
  inflector.underscore(slice)
end