Class: ODDB::Html::View::GoogleAds

Inherits:
HtmlGrid::Component
  • Object
show all
Defined in:
lib/oddb/html/view/google_ads.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {:channel => '2298340258', :width => 250, :height => 250}) ⇒ GoogleAds

Returns a new instance of GoogleAds.



10
11
12
13
14
15
16
# File 'lib/oddb/html/view/google_ads.rb', line 10

def initialize(opts = {:channel => '2298340258', :width => 250, :height => 250})
  @channel = opts[:channel]
  @width = opts[:width]
  @height = opts[:height]
  @format = "#{@width}x#{@height}_as"
  super
end

Instance Method Details

#to_html(context) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/oddb/html/view/google_ads.rb', line 17

def to_html(context)
  <<-EOS
<script type="text/javascript"><!--
google_ad_client = "pub-6948570700973491";
google_ad_width = "#{@width}";
google_ad_height = "#{@height}";
google_ad_format = "#{@format}";
google_ad_channel ="#{@channel}";
google_ad_type = "text_image";
google_color_border = "DBE1D6";
google_color_bg = "E6FFD6";
google_color_link = "003366";
google_color_url = "FF3300";
google_color_text = "003399";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
  EOS
end