gtm_on_rails 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gtm_on_rails/models/data_layer.rb +17 -5
- data/lib/gtm_on_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf2d915f6db050d579fa7f4cb73b1923323b0f77
|
4
|
+
data.tar.gz: 33b15520b4b2e31d46b151372ee24f9c558ae928
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ec31b4b9d2ec1850cd8645a3795a4cd277c69e942cb7726f5b9019807469c78f51ba2eeb341212ca4502fa7b34918b8317045b55f8f8df5bfe3434693acd21a
|
7
|
+
data.tar.gz: 8c4e1369595539088d60d6af74601e26fbd0528208d481c6cf38f7f57809e2ad71e2a93deeb3257b053c4b23403f6a66d73c6d9ca809e3d80684c7d5b329d3ac
|
@@ -3,16 +3,16 @@ module GtmOnRails
|
|
3
3
|
class DataLayer
|
4
4
|
include ActionView::Helpers::TagHelper
|
5
5
|
|
6
|
-
|
6
|
+
attr_accessor :objects
|
7
7
|
|
8
8
|
def initialize(*args)
|
9
9
|
options = args.extract_options!
|
10
|
-
@objects = args # @objects are instances of GTM::DataLayerObject
|
10
|
+
@objects = [args].flatten # @objects are instances of GTM::DataLayerObject
|
11
11
|
end
|
12
12
|
|
13
|
-
def push(
|
14
|
-
|
15
|
-
|
13
|
+
def push(args)
|
14
|
+
args = [args].flatten
|
15
|
+
args.each do |object|
|
16
16
|
case object
|
17
17
|
when Hash
|
18
18
|
@objects << GtmOnRails::DataLayer::Object.new(object)
|
@@ -43,5 +43,17 @@ module GtmOnRails
|
|
43
43
|
def print_on_html
|
44
44
|
content_tag(:script, self.to_js)
|
45
45
|
end
|
46
|
+
|
47
|
+
def method_missing(method, *args, &block)
|
48
|
+
if @objects.respond_to?(method)
|
49
|
+
@objects.send(method, *args, &block)
|
50
|
+
else
|
51
|
+
super
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def respond_to?(method, include_all=false)
|
56
|
+
Array.new.respond_to?(method, include_all) || super
|
57
|
+
end
|
46
58
|
end
|
47
59
|
end
|
data/lib/gtm_on_rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gtm_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ykogure
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|