Class: BingAdsApi::AdGroup
- Inherits:
-
DataObject
- Object
- DataObject
- BingAdsApi::AdGroup
- Includes:
- AdDistribution, AdGroupStatus, AdLanguage, AdRotationType, BiddingModel, PricingModel
- Defined in:
- lib/bing-ads-api/data/ad_group.rb
Overview
Public : Defines an ad group.
- Author
Examples
ad_group = BingAdsApi::AdGroup.new(
:ad_distribution => BingAdsApi::AdGroup::SEARCH,
:language => BingAdsApi::AdGroup::SPANISH,
:name => "Ad Group name",
:pricing_model => BingAdsApi::AdGroup::CPC,
:bidding_model => BingAdsApi::AdGroup::KEYWORD)
# => <BingAdsApi::AdGroup>
Instance Attribute Summary collapse
-
#ad_distribution ⇒ Object
Returns the value of attribute ad_distribution.
-
#ad_rotation ⇒ Object
Returns the value of attribute ad_rotation.
-
#bidding_model ⇒ Object
Returns the value of attribute bidding_model.
-
#broad_match_bid ⇒ Object
Returns the value of attribute broad_match_bid.
-
#content_match_bid ⇒ Object
Returns the value of attribute content_match_bid.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#exact_match_bid ⇒ Object
Returns the value of attribute exact_match_bid.
-
#id ⇒ Object
Returns the value of attribute id.
-
#language ⇒ Object
Returns the value of attribute language.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phrase_match_bid ⇒ Object
Returns the value of attribute phrase_match_bid.
-
#pricing_model ⇒ Object
Returns the value of attribute pricing_model.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ AdGroup
constructor
Public : Constructor in a ActiveRecord style, with a hash of attributes as input .
-
#to_hash(keys = :underscore) ⇒ Object
Public : Returns this object as a hash to SOAP requests This methods is a specialization for the DataObject#to_hash method that ads specific hash keys for the AdGroup object.
Methods inherited from DataObject
Methods included from SOAPHasheable
#date_to_hash, #get_attribute_key, #normalize_hash_keys, #object_to_hash
Constructor Details
#initialize(attributes = {}) ⇒ AdGroup
Public : Constructor in a ActiveRecord style, with a hash of attributes as input
- Author
attributes - Hash with the objects attributes
52 53 54 55 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 52 def initialize(attributes={}) super(attributes) set_custom_attributes(attributes) end |
Instance Attribute Details
#ad_distribution ⇒ Object
Returns the value of attribute ad_distribution.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def ad_distribution @ad_distribution end |
#ad_rotation ⇒ Object
Returns the value of attribute ad_rotation.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def ad_rotation @ad_rotation end |
#bidding_model ⇒ Object
Returns the value of attribute bidding_model.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def bidding_model @bidding_model end |
#broad_match_bid ⇒ Object
Returns the value of attribute broad_match_bid.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def broad_match_bid @broad_match_bid end |
#content_match_bid ⇒ Object
Returns the value of attribute content_match_bid.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def content_match_bid @content_match_bid end |
#end_date ⇒ Object
Returns the value of attribute end_date.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def end_date @end_date end |
#exact_match_bid ⇒ Object
Returns the value of attribute exact_match_bid.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def exact_match_bid @exact_match_bid end |
#id ⇒ Object
Returns the value of attribute id.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def id @id end |
#language ⇒ Object
Returns the value of attribute language.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def language @language end |
#name ⇒ Object
Returns the value of attribute name.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def name @name end |
#phrase_match_bid ⇒ Object
Returns the value of attribute phrase_match_bid.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def phrase_match_bid @phrase_match_bid end |
#pricing_model ⇒ Object
Returns the value of attribute pricing_model.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def pricing_model @pricing_model end |
#start_date ⇒ Object
Returns the value of attribute start_date.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def start_date @start_date end |
#status ⇒ Object
Returns the value of attribute status.
26 27 28 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 26 def status @status end |
Instance Method Details
#to_hash(keys = :underscore) ⇒ Object
Public : Returns this object as a hash to SOAP requests This methods is a specialization for the DataObject#to_hash method that ads specific hash keys for the AdGroup object
- Author
keys - specifies the keys case: CamelCase or underscore_case
- Returns
-
Hash
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/bing-ads-api/data/ad_group.rb', line 67 def to_hash(keys = :underscore) hash = super(keys) amount_key = get_attribute_key("amount", keys) if self.content_match_bid #hash.delete(:content_match_bid) hash[get_attribute_key("content_match_bid", keys)] = {amount_key => self.content_match_bid} end if self.exact_match_bid hash[get_attribute_key("exact_match_bid", keys)] = {amount_key => self.exact_match_bid} end if self.phrase_match_bid hash[get_attribute_key("phrase_match_bid", keys)] = {amount_key => self.phrase_match_bid} end if self.broad_match_bid hash[get_attribute_key("broad_match_bid", keys)] = {amount_key => self.broad_match_bid} end if self.start_date hash[get_attribute_key("start_date", keys)] = date_to_hash(self.start_date, keys) end if self.end_date hash[get_attribute_key("end_date", keys)] = date_to_hash(self.end_date, keys) end return hash end |