Class: Gamco::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/gamco/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(view) ⇒ Builder

Returns a new instance of Builder.



7
8
9
# File 'lib/gamco/builder.rb', line 7

def initialize(view)
  @view = view
end

Instance Attribute Details

#viewObject (readonly)

Returns the value of attribute view.



5
6
7
# File 'lib/gamco/builder.rb', line 5

def view
  @view
end

Instance Method Details

#javascript_tags(tag_id, options = {}) ⇒ Object



11
12
13
14
# File 'lib/gamco/builder.rb', line 11

def javascript_tags(tag_id, options = {})
  gtag_manager_script(tag_id) +
    gtag_script(tag_id, options)
end

#tag(type, event, options = {}) ⇒ Object



16
17
18
19
20
21
# File 'lib/gamco/builder.rb', line 16

def tag(type, event, options = {})
  view.(:script) do
    dimensions = options.to_json
    "gtag('#{type}', '#{event}', #{dimensions})".html_safe
  end
end