Class: PocketMath::Advertiser::V1::InsertionOrderStats
- Inherits:
-
Object
- Object
- PocketMath::Advertiser::V1::InsertionOrderStats
- Defined in:
- lib/model/insertion_order_stats.rb
Instance Attribute Summary collapse
-
#clicks ⇒ Object
readonly
Returns the value of attribute clicks.
-
#conversions ⇒ Object
readonly
Returns the value of attribute conversions.
-
#cpa ⇒ Object
readonly
Cost per Action (Cost per Conversion).
-
#cpc ⇒ Object
readonly
Cost per Click.
-
#cpm ⇒ Object
readonly
Cost per thousand Impressions.
-
#ctr ⇒ Object
readonly
Click-through Rate (Clicks per impression).
-
#impressions ⇒ Object
readonly
Returns the value of attribute impressions.
-
#spend ⇒ Object
readonly
Ad spend in currency.
Class Method Summary collapse
-
.create(opts = {}) ⇒ Object
Create a new instance.
Instance Attribute Details
#clicks ⇒ Object
Returns the value of attribute clicks.
17 18 19 |
# File 'lib/model/insertion_order_stats.rb', line 17 def clicks @clicks end |
#conversions ⇒ Object
Returns the value of attribute conversions.
17 18 19 |
# File 'lib/model/insertion_order_stats.rb', line 17 def conversions @conversions end |
#cpa ⇒ Object
Cost per Action (Cost per Conversion)
12 13 14 |
# File 'lib/model/insertion_order_stats.rb', line 12 def cpa @cpa end |
#cpc ⇒ Object
Cost per Click
9 10 11 |
# File 'lib/model/insertion_order_stats.rb', line 9 def cpc @cpc end |
#cpm ⇒ Object
Cost per thousand Impressions
6 7 8 |
# File 'lib/model/insertion_order_stats.rb', line 6 def cpm @cpm end |
#ctr ⇒ Object
Click-through Rate (Clicks per impression)
15 16 17 |
# File 'lib/model/insertion_order_stats.rb', line 15 def ctr @ctr end |
#impressions ⇒ Object
Returns the value of attribute impressions.
17 18 19 |
# File 'lib/model/insertion_order_stats.rb', line 17 def impressions @impressions end |
#spend ⇒ Object
Ad spend in currency
20 21 22 |
# File 'lib/model/insertion_order_stats.rb', line 20 def spend @spend end |
Class Method Details
.create(opts = {}) ⇒ Object
Create a new instance.
-
Specify attributes in a hash as { :cpm => 1.25, :cpc => 2.33, … }
32 33 34 35 36 37 38 |
# File 'lib/model/insertion_order_stats.rb', line 32 def self.create(opts = {}) iostats = InsertionOrderStats.new opts.each_pair do |k,v| raise "#{k.to_s}=#{v} was not a number" if !v.is_a?(Numeric) iostats.send(k.to_s + "=", v) end end |