Class: Wallaby::PrefixesBuilder
- Inherits:
-
Object
- Object
- Wallaby::PrefixesBuilder
- Includes:
- ActiveModel::Model
- Defined in:
- lib/services/wallaby/prefixes_builder.rb
Instance Attribute Summary collapse
- #controller_class ⇒ String
- #prefixes ⇒ Array<String>
- #resources_name ⇒ String?
- #script_name ⇒ String
Instance Method Summary collapse
-
#execute ⇒ Array<String>
To extend prefixes to be able to look up the directory even if the custom controller doesn’t not exist.
Instance Attribute Details
#controller_class ⇒ String
21 22 23 |
# File 'lib/services/wallaby/prefixes_builder.rb', line 21 def controller_class @controller_class end |
#prefixes ⇒ Array<String>
12 13 14 |
# File 'lib/services/wallaby/prefixes_builder.rb', line 12 def prefixes @prefixes end |
#resources_name ⇒ String?
15 16 17 |
# File 'lib/services/wallaby/prefixes_builder.rb', line 15 def resources_name @resources_name end |
#script_name ⇒ String
18 19 20 |
# File 'lib/services/wallaby/prefixes_builder.rb', line 18 def script_name @script_name end |
Instance Method Details
#execute ⇒ Array<String>
To extend prefixes to be able to look up the directory even if the custom controller doesn’t not exist
26 27 28 29 30 31 32 33 34 |
# File 'lib/services/wallaby/prefixes_builder.rb', line 26 def execute return prefixes_dup unless resourceful? return prefixes_dup if possible_resources_path == controller_path prefixes_dup.insert( prefixes_dup.index(controller_path) + offset, possible_resources_path ) end |