Class: APDM::AdTech::AdLoader
- Inherits:
-
Object
- Object
- APDM::AdTech::AdLoader
- Defined in:
- lib/apdm/ad_tech/ad_loader.rb
Constant Summary collapse
- APDM_NETWORK_ID =
1361.1
- KAMPANJE_NETWORK_ID =
893.1
Instance Attribute Summary collapse
-
#channel_name ⇒ Object
readonly
Returns the value of attribute channel_name.
-
#context_key ⇒ Object
readonly
Returns the value of attribute context_key.
-
#dimensions_id ⇒ Object
readonly
Returns the value of attribute dimensions_id.
-
#dom_prefix ⇒ Object
readonly
Returns the value of attribute dom_prefix.
-
#group_id ⇒ Object
readonly
Returns the value of attribute group_id.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#network_id ⇒ Object
readonly
Returns the value of attribute network_id.
-
#placement_id ⇒ Object
readonly
Returns the value of attribute placement_id.
-
#placement_name ⇒ Object
readonly
Returns the value of attribute placement_name.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(options) ⇒ AdLoader
constructor
A new instance of AdLoader.
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ AdLoader
Returns a new instance of AdLoader.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 9 def initialize() @dom_prefix = "ad_tech_loader_#{SecureRandom.random_number(2 ** 64).to_s(36)}" @network_id = [:channel_name] == "Kampanje" ? KAMPANJE_NETWORK_ID : APDM_NETWORK_ID @key = [:key] @context_key = [:context_key] @placement_name = [:placement_name] @placement_id = [:placement_id] @dimensions_id = [:dimensions_id] @height = [:height] @width = [:width] @channel_name = [:channel_name] @group_id = [:group_id] end |
Instance Attribute Details
#channel_name ⇒ Object (readonly)
Returns the value of attribute channel_name.
8 9 10 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 8 def channel_name @channel_name end |
#context_key ⇒ Object (readonly)
Returns the value of attribute context_key.
8 9 10 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 8 def context_key @context_key end |
#dimensions_id ⇒ Object (readonly)
Returns the value of attribute dimensions_id.
8 9 10 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 8 def dimensions_id @dimensions_id end |
#dom_prefix ⇒ Object (readonly)
Returns the value of attribute dom_prefix.
8 9 10 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 8 def dom_prefix @dom_prefix end |
#group_id ⇒ Object (readonly)
Returns the value of attribute group_id.
8 9 10 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 8 def group_id @group_id end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
8 9 10 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 8 def height @height end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
8 9 10 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 8 def key @key end |
#network_id ⇒ Object (readonly)
Returns the value of attribute network_id.
8 9 10 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 8 def network_id @network_id end |
#placement_id ⇒ Object (readonly)
Returns the value of attribute placement_id.
8 9 10 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 8 def placement_id @placement_id end |
#placement_name ⇒ Object (readonly)
Returns the value of attribute placement_name.
8 9 10 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 8 def placement_name @placement_name end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
8 9 10 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 8 def width @width end |
Instance Method Details
#to_s ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/apdm/ad_tech/ad_loader.rb', line 23 def to_s <<-ADSTRING.gsub(/^\s{10}/, '') #{start_ad_tech_loader} <script> document.write('<scr'+'ipt language="javascript1.1" src="#{url('addyn', 100)};misc='+new Date().getTime()+'"></scri'+'pt>'); </script> <noscript> <a href="#{url('adlink', 300, '')}" target="_blank"> <img src="#{url('adserv', 300, '')}" border="0" width="#{width}" height="#{height}"> </a> </noscript> ADSTRING end |