Class: AuthorizedRailsScaffolds::Helper
- Inherits:
-
Object
- Object
- AuthorizedRailsScaffolds::Helper
- Defined in:
- lib/authorized_rails_scaffolds/helper.rb
Direct Known Subclasses
RSpecScaffoldHelper, RailsErbScaffoldHelper, RailsHelperHelper, RailsScaffoldControllerHelper
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Helper
constructor
A new instance of Helper.
- #plural_var_name ⇒ Object
- #shallow_routes? ⇒ Boolean
-
#var_name ⇒ Object
Non-namespaced variable name (i.e. foo_bar).
Methods included from Macros::ResourceMacros
#resource_array_name, #resource_array_sym, #resource_array_var, #resource_class, #resource_directory, #resource_human_name, #resource_name, #resource_symbol, #resource_var
Methods included from Macros::PathMacros
#controller_edit_route, #controller_index_path, #controller_index_route, #controller_new_route, #controller_show_route, #references_show_route
Methods included from Macros::ParentMacros
#model_parent_name, #parent_model_names, #parent_models, #parent_module_groups, #parent_modules, #parent_sym, #parent_variable, #parent_variables
Constructor Details
#initialize(options = {}) ⇒ Helper
Returns a new instance of Helper.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/authorized_rails_scaffolds/helper.rb', line 7 def initialize( = {}) # @local_class_name = options[:local_class_name] # Fix for potentially plural file_name value file_name = [:file_name] file_name = file_name.singularize unless file_name.nil? @var_name = [:var_name] || file_name # Non-namespaced variable name # Pluralized non-namespaced variable name @plural_var_name ||= [:plural_var_name] # Determine namespace prefix i.e awesome # options[:namespace_prefix] @singular_table_name = [:singular_table_name] @human_name = [:human_name] end |
Instance Method Details
#plural_var_name ⇒ Object
32 33 34 |
# File 'lib/authorized_rails_scaffolds/helper.rb', line 32 def plural_var_name @plural_var_name end |
#shallow_routes? ⇒ Boolean
36 37 38 |
# File 'lib/authorized_rails_scaffolds/helper.rb', line 36 def shallow_routes? !!AuthorizedRailsScaffolds.config.shallow_routes end |
#var_name ⇒ Object
Non-namespaced variable name (i.e. foo_bar)
28 29 30 |
# File 'lib/authorized_rails_scaffolds/helper.rb', line 28 def var_name @var_name end |