Class: ACTV::Asset
Instance Attribute Summary collapse
-
#activityEndDate ⇒ Object
(also: #end_date)
readonly
Returns the value of attribute activityEndDate.
-
#activityEndTime ⇒ Object
(also: #end_time)
readonly
Returns the value of attribute activityEndTime.
-
#activityStartDate ⇒ Object
(also: #start_date)
readonly
Returns the value of attribute activityStartDate.
-
#activityStartTime ⇒ Object
(also: #start_time)
readonly
Returns the value of attribute activityStartTime.
-
#assetDsc ⇒ Object
readonly
Returns the value of attribute assetDsc.
-
#assetGuid ⇒ Object
(also: #id)
readonly
Returns the value of attribute assetGuid.
-
#assetName ⇒ Object
(also: #title)
readonly
Returns the value of attribute assetName.
-
#authorName ⇒ Object
(also: #author_name)
readonly
Returns the value of attribute authorName.
-
#contactEmailAdr ⇒ Object
(also: #contact_email)
readonly
Returns the value of attribute contactEmailAdr.
-
#contactName ⇒ Object
(also: #contact_name)
readonly
Returns the value of attribute contactName.
-
#contactPhone ⇒ Object
(also: #contact_phone)
readonly
Returns the value of attribute contactPhone.
-
#createdDate ⇒ Object
(also: #created_at)
readonly
Returns the value of attribute createdDate.
-
#homePageUrlAdr ⇒ Object
(also: #home_page_url)
readonly
Returns the value of attribute homePageUrlAdr.
-
#is_article ⇒ Object
readonly
Returns the value of attribute is_article.
-
#is_event ⇒ Object
readonly
Returns the value of attribute is_event.
-
#isRecurring ⇒ Object
(also: #is_recurring?)
readonly
Returns the value of attribute isRecurring.
-
#modifiedDate ⇒ Object
(also: #updated_at)
readonly
Returns the value of attribute modifiedDate.
-
#publishDate ⇒ Object
(also: #published_at)
readonly
Returns the value of attribute publishDate.
-
#showContact ⇒ Object
(also: #show_contact?)
readonly
Returns the value of attribute showContact.
Attributes inherited from Base
Instance Method Summary collapse
- #channels ⇒ Object (also: #asset_channels, #assetChannels)
- #components ⇒ Object (also: #asset_components, #assetComponents)
- #description ⇒ Object
- #description_by_type(type) ⇒ Object
- #descriptions ⇒ Object (also: #asset_descriptions, #assetDescriptions)
- #evergreen? ⇒ Boolean
- #image_by_name(name) ⇒ Object
- #images ⇒ Object (also: #asset_images, #assetImages)
- #is_article? ⇒ Boolean
- #is_event? ⇒ Boolean
- #legacy_data ⇒ Object (also: #asset_legacy_data, #assetLegacyData)
- #place ⇒ Object
- #place_timezone ⇒ Object
- #prices ⇒ Object (also: #asset_prices, #assetPrices)
- #registration_status ⇒ Object (also: #reg_status)
- #seo_url(systemName = 'as3') ⇒ Object
- #seo_urls ⇒ Object (also: #asset_seo_urls, #assetSeoUrls)
- #status ⇒ Object (also: #asset_status, #assetStatus)
- #summary ⇒ Object
- #tag_by_description(description) ⇒ Object
- #tags ⇒ Object (also: #asset_tags, #assetTags)
- #topics ⇒ Object (also: #asset_topics, #assetTopics)
Methods inherited from Identity
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, from_response, #initialize, #memoize, #method_missing, object_attr_reader, #respond_to?, #to_hash, uri_attr_reader
Constructor Details
This class inherits a constructor from ACTV::Identity
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ACTV::Base
Instance Attribute Details
#activityEndDate ⇒ Object (readonly) Also known as: end_date
Returns the value of attribute activityEndDate.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def activityEndDate @activityEndDate end |
#activityEndTime ⇒ Object (readonly) Also known as: end_time
Returns the value of attribute activityEndTime.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def activityEndTime @activityEndTime end |
#activityStartDate ⇒ Object (readonly) Also known as: start_date
Returns the value of attribute activityStartDate.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def activityStartDate @activityStartDate end |
#activityStartTime ⇒ Object (readonly) Also known as: start_time
Returns the value of attribute activityStartTime.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def activityStartTime @activityStartTime end |
#assetDsc ⇒ Object (readonly)
Returns the value of attribute assetDsc.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def assetDsc @assetDsc end |
#assetGuid ⇒ Object (readonly) Also known as: id
Returns the value of attribute assetGuid.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def assetGuid @assetGuid end |
#assetName ⇒ Object (readonly) Also known as: title
Returns the value of attribute assetName.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def assetName @assetName end |
#authorName ⇒ Object (readonly) Also known as:
Returns the value of attribute authorName.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def @authorName end |
#contactEmailAdr ⇒ Object (readonly) Also known as: contact_email
Returns the value of attribute contactEmailAdr.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def contactEmailAdr @contactEmailAdr end |
#contactName ⇒ Object (readonly) Also known as: contact_name
Returns the value of attribute contactName.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def contactName @contactName end |
#contactPhone ⇒ Object (readonly) Also known as: contact_phone
Returns the value of attribute contactPhone.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def contactPhone @contactPhone end |
#createdDate ⇒ Object (readonly) Also known as: created_at
Returns the value of attribute createdDate.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def createdDate @createdDate end |
#homePageUrlAdr ⇒ Object (readonly) Also known as: home_page_url
Returns the value of attribute homePageUrlAdr.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def homePageUrlAdr @homePageUrlAdr end |
#is_article ⇒ Object (readonly)
Returns the value of attribute is_article.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def is_article @is_article end |
#is_event ⇒ Object (readonly)
Returns the value of attribute is_event.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def is_event @is_event end |
#isRecurring ⇒ Object (readonly) Also known as: is_recurring?
Returns the value of attribute isRecurring.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def isRecurring @isRecurring end |
#modifiedDate ⇒ Object (readonly) Also known as: updated_at
Returns the value of attribute modifiedDate.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def modifiedDate @modifiedDate end |
#publishDate ⇒ Object (readonly) Also known as: published_at
Returns the value of attribute publishDate.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def publishDate @publishDate end |
#showContact ⇒ Object (readonly) Also known as: show_contact?
Returns the value of attribute showContact.
17 18 19 |
# File 'lib/actv/asset.rb', line 17 def showContact @showContact end |
Instance Method Details
#channels ⇒ Object Also known as: asset_channels, assetChannels
66 67 68 69 70 |
# File 'lib/actv/asset.rb', line 66 def channels @asset_channels ||= Array(@attrs[:assetChannels]).map do |channel| ACTV::AssetChannel.new(channel) end end |
#components ⇒ Object Also known as: asset_components, assetComponents
90 91 92 93 94 |
# File 'lib/actv/asset.rb', line 90 def components @asset_components ||= Array(@attrs[:assetComponents]).map do |component| ACTV::AssetComponent.new(component) end end |
#description ⇒ Object
126 127 128 |
# File 'lib/actv/asset.rb', line 126 def description @description ||= description_by_type 'Standard' end |
#description_by_type(type) ⇒ Object
135 136 137 138 |
# File 'lib/actv/asset.rb', line 135 def description_by_type(type) dsc = self.descriptions.find { |dsc| dsc.type.name.downcase == type.downcase } (dsc.description.downcase == 'n/a' ? '' : dsc.description) if dsc end |
#descriptions ⇒ Object Also known as: asset_descriptions, assetDescriptions
46 47 48 49 50 |
# File 'lib/actv/asset.rb', line 46 def descriptions @descriptions ||= Array(@attrs[:assetDescriptions]).map do |description| ACTV::AssetDescription.new(description) end end |
#evergreen? ⇒ Boolean
177 178 179 |
# File 'lib/actv/asset.rb', line 177 def evergreen? self.evergreenAssetFlag.downcase == 'true' rescue false end |
#image_by_name(name) ⇒ Object
140 141 142 |
# File 'lib/actv/asset.rb', line 140 def image_by_name(name) self.images.find { |img| img.name.downcase == name.downcase } end |
#images ⇒ Object Also known as: asset_images, assetImages
74 75 76 77 78 |
# File 'lib/actv/asset.rb', line 74 def images @images ||= Array(@attrs[:assetImages]).map do |img| ACTV::AssetImage.new(img) end end |
#is_article? ⇒ Boolean
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/actv/asset.rb', line 158 def is_article? is_article = false if self.assetCategories.any? self.assetCategories.each do |category| if category[:category][:categoryName].downcase == 'articles' is_article = true end end else # no categories so check the sourceSystem # this guid is equal to the Active.com Articles if self.sourceSystem.fetch(:legacyGuid, "").upcase == "CA4EA0B1-7377-470D-B20D-BF6BEA23F040" is_article = true end end is_article end |
#is_event? ⇒ Boolean
149 150 151 152 153 154 155 156 |
# File 'lib/actv/asset.rb', line 149 def is_event? self.assetCategories.each do |category| if category[:category][:categoryTaxonomy].downcase.start_with?('event') return true end end false end |
#legacy_data ⇒ Object Also known as: asset_legacy_data, assetLegacyData
60 61 62 |
# File 'lib/actv/asset.rb', line 60 def legacy_data @legacy_data ||= ACTV::AssetLegacyData.new(@attrs[:assetLegacyData]) unless @attrs[:assetLegacyData].nil? end |
#place ⇒ Object
38 39 40 |
# File 'lib/actv/asset.rb', line 38 def place @place ||= ACTV::Place.new(@attrs[:place]) unless @attrs[:place].nil? end |
#place_timezone ⇒ Object
42 43 44 |
# File 'lib/actv/asset.rb', line 42 def place_timezone @timezone ||= place[:timezone] unless place[:timezone].nil? end |
#prices ⇒ Object Also known as: asset_prices, assetPrices
98 99 100 101 102 |
# File 'lib/actv/asset.rb', line 98 def prices @asset_prices ||= Array(@attrs[:assetPrices]).map do |price| ACTV::AssetPrice.new(price) end end |
#registration_status ⇒ Object Also known as: reg_status
181 182 183 |
# File 'lib/actv/asset.rb', line 181 def registration_status @registration_status ||= nil end |
#seo_url(systemName = 'as3') ⇒ Object
130 131 132 133 |
# File 'lib/actv/asset.rb', line 130 def seo_url(systemName = 'as3') seo_url = self.seo_urls.find { |s| s.seoSystemName.downcase == systemName.downcase } seo_url.urlAdr unless seo_url.nil? end |
#seo_urls ⇒ Object Also known as: asset_seo_urls, assetSeoUrls
114 115 116 117 118 |
# File 'lib/actv/asset.rb', line 114 def seo_urls @seo_urls ||= Array(@attrs[:assetSeoUrls]).map do |seo_url| ACTV::AssetSeoUrl.new(seo_url) end end |
#status ⇒ Object Also known as: asset_status, assetStatus
54 55 56 |
# File 'lib/actv/asset.rb', line 54 def status @status ||= ACTV::AssetStatus.new(@attrs[:assetStatus]) unless @attrs[:assetStatus].nil? end |
#summary ⇒ Object
122 123 124 |
# File 'lib/actv/asset.rb', line 122 def summary @summary ||= description_by_type 'summary' end |
#tag_by_description(description) ⇒ Object
144 145 146 147 |
# File 'lib/actv/asset.rb', line 144 def tag_by_description(description) asset_tag = self..find { |at| at.tag.description.downcase == description.downcase } asset_tag.tag.name if asset_tag end |
#tags ⇒ Object Also known as: , assetTags
82 83 84 85 86 |
# File 'lib/actv/asset.rb', line 82 def @asset_tags ||= Array(@attrs[:assetTags]).map do |tag| ACTV::AssetTag.new(tag) end end |
#topics ⇒ Object Also known as: asset_topics, assetTopics
106 107 108 109 110 |
# File 'lib/actv/asset.rb', line 106 def topics @asset_topics ||= Array(@attrs[:assetTopics]).map do |topic| ACTV::AssetTopic.new(topic) end end |