rails-sweetalert2-confirm 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0cd658ff78d75c579059054339cd259dec87bec
4
- data.tar.gz: 6af27c299fa9f8e782278afca1df670c3b6cb8b2
3
+ metadata.gz: dd16665f4747d5ba63d484e14233a8b780ab8b06
4
+ data.tar.gz: 6688a931595c4f91dce4de7d5180f27c371e5f7b
5
5
  SHA512:
6
- metadata.gz: 012be30f1ed1d91734bc4460661bfe43b74ae4c722068aff585929f6209bb7de37e29a114cc40dce9df74cdf299efe8f9b4e71d1aad9455e73d77347ec8a7271
7
- data.tar.gz: dfeebee5698c0142ee4ea616e701ba9850b0631de3178fa949c996bac8b6ef2a8b171cc8764980396cf4f8ed2ec60b255c180a9d1856d118bf91a930f5e0dce5
6
+ metadata.gz: bb4eec7955ab8e4613d2b631782d25f53544c6a7ff00e9ec6316a9ab8b35a883e9dc0bf31a0f190e712202b166c330b3db1fd532853fde4bb1ba451e4bbc1b60
7
+ data.tar.gz: 1cd75ec42ec9fd0839b687b1d0f7968d77588d60d131ba1cee975f32fdc99c3c287d917c516ff9162c2b0b6e410e9e74f3a92b93b82377ecc783c2f0ee4e73c1
@@ -1,3 +1,3 @@
1
1
  module RailsSweetAlert2Confirm
2
- VERSION = "0.9.4"
2
+ VERSION = "0.9.5"
3
3
  end
@@ -29,18 +29,27 @@ module RailsSweetAlert2Confirm
29
29
  merge_remote_into_swal(options)
30
30
  end
31
31
 
32
- %w(confirm remote).each do |option|
32
+ %w(confirm remote method).each do |option|
33
33
  define_method("merge_#{option}_into_swal") do |options|
34
34
  if send("options_has_#{option}?", options)
35
35
  options[:data] ||= {}
36
36
  options[:data][:swal] ||= {}
37
37
  option = option.to_sym
38
38
  options[:data][:swal][SWAL_OPTIONS_MAPPINGS[option]] =
39
- options.delete(option) || options[:data].delete(option)
39
+ send("retrieve_#{option}_from", options)
40
40
  end
41
41
  options
42
42
  end
43
43
 
44
+ define_method("retrieve_#{option}_from") do |options|
45
+ case option
46
+ when "method"
47
+ options[option] || options[:data][option]
48
+ else
49
+ options.delete(option) || options[:data].delete(option)
50
+ end
51
+ end
52
+
44
53
  define_method("options_has_#{option}?") do |options|
45
54
  option = option.to_sym
46
55
  (options[option] || options[:data].try(:[], option)).present?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-sweetalert2-confirm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Woodward