Class: Gamco::Builder
- Inherits:
-
Object
- Object
- Gamco::Builder
- Defined in:
- lib/gamco/builder.rb
Instance Attribute Summary collapse
-
#view ⇒ Object
readonly
Returns the value of attribute view.
Instance Method Summary collapse
-
#initialize(view) ⇒ Builder
constructor
A new instance of Builder.
- #javascript_tags(tag_id, options = {}) ⇒ Object
- #tag(type, event, options = {}) ⇒ Object
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
#view ⇒ Object (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 (tag_id, = {}) gtag_manager_script(tag_id) + gtag_script(tag_id, ) end |
#tag(type, event, options = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/gamco/builder.rb', line 16 def tag(type, event, = {}) view.content_tag(:script) do dimensions = .to_json "gtag('#{type}', '#{event}', #{dimensions})".html_safe end end |