Module: JumpBack::HelpersArguments
- Defined in:
- lib/jump_back/link_back.rb
Class Method Summary collapse
- .first_arg_is_path?(name, path, root_path) ⇒ Boolean
- .parse(name, path, options, root_path) ⇒ Object
Class Method Details
.first_arg_is_path?(name, path, root_path) ⇒ Boolean
27 28 29 |
# File 'lib/jump_back/link_back.rb', line 27 def self.first_arg_is_path?(name, path, root_path) Urls.is_url?(name) && (path == root_path || path.is_a?(Hash)) end |
.parse(name, path, options, root_path) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/jump_back/link_back.rb', line 13 def self.parse(name, path, , root_path) if first_arg_is_path?(name, path, root_path) = path if path.is_a? Hash path = name name = 'back' end if name.is_a? Hash = name name = 'back' end = OptionsParser.new(default: root_path, path: path, options: ) { name: name, path: .path, jump_back_options: ., redirect_options: . } end |