Class: ACTV::Asset
Instance Attribute Summary collapse
Attributes inherited from Base
#attrs
Instance Method Summary
collapse
-
#awcamps? ⇒ Boolean
-
#awendurance? ⇒ Boolean
-
#awsports? ⇒ Boolean
-
#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)
-
#org_timezone ⇒ Object
-
#place ⇒ Object
-
#place_timezone ⇒ Object
-
#prices ⇒ Object
(also: #asset_prices, #assetPrices)
-
#regcenter2? ⇒ Boolean
-
#regcenter? ⇒ Boolean
-
#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)
-
#thriva? ⇒ Boolean
-
#topics ⇒ Object
(also: #asset_topics, #assetTopics)
-
#version ⇒ Object
Methods inherited from Identity
#==, #initialize
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
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
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
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
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
Returns the value of attribute assetDsc.
17
18
19
|
# File 'lib/actv/asset.rb', line 17
def assetDsc
@assetDsc
end
|
#assetGuid ⇒ Object
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
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
Also known as:
author_name
Returns the value of attribute authorName.
17
18
19
|
# File 'lib/actv/asset.rb', line 17
def authorName
@authorName
end
|
Returns the value of attribute contactEmailAdr.
17
18
19
|
# File 'lib/actv/asset.rb', line 17
def contactEmailAdr
@contactEmailAdr
end
|
Returns the value of attribute contactName.
17
18
19
|
# File 'lib/actv/asset.rb', line 17
def contactName
@contactName
end
|
Returns the value of attribute contactPhone.
17
18
19
|
# File 'lib/actv/asset.rb', line 17
def contactPhone
@contactPhone
end
|
#createdDate ⇒ Object
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
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
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
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
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
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
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
|
Returns the value of attribute showContact.
17
18
19
|
# File 'lib/actv/asset.rb', line 17
def showContact
@showContact
end
|
Instance Method Details
#awcamps? ⇒ Boolean
205
206
207
|
# File 'lib/actv/asset.rb', line 205
def awcamps?
self.sourceSystem[:legacyGuid].upcase == "2B22B4E6-5AA4-44D7-BF06-F7A71F9FA8A6" rescue false
end
|
#awendurance? ⇒ Boolean
197
198
199
|
# File 'lib/actv/asset.rb', line 197
def awendurance?
self.sourceSystem[:legacyGuid].upcase == "DFAA997A-D591-44CA-9FB7-BF4A4C8984F1" rescue false
end
|
#awsports? ⇒ Boolean
201
202
203
|
# File 'lib/actv/asset.rb', line 201
def awsports?
self.sourceSystem[:legacyGuid].upcase == "F036B0FF-2B21-43A9-8C20-7F447D3AB105" rescue false
end
|
#channels ⇒ Object
Also known as:
asset_channels, assetChannels
74
75
76
77
78
|
# File 'lib/actv/asset.rb', line 74
def channels
@asset_channels ||= Array(@attrs[:assetChannels]).map do |channel|
ACTV::AssetChannel.new(channel)
end
end
|
#components ⇒ Object
Also known as:
asset_components, assetComponents
98
99
100
101
102
|
# File 'lib/actv/asset.rb', line 98
def components
@asset_components ||= Array(@attrs[:assetComponents]).map do |component|
ACTV::AssetComponent.new(component)
end
end
|
#description ⇒ Object
134
135
136
|
# File 'lib/actv/asset.rb', line 134
def description
@description ||= description_by_type 'Standard'
end
|
#description_by_type(type) ⇒ Object
143
144
145
146
|
# File 'lib/actv/asset.rb', line 143
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
54
55
56
57
58
|
# File 'lib/actv/asset.rb', line 54
def descriptions
@descriptions ||= Array(@attrs[:assetDescriptions]).map do |description|
ACTV::AssetDescription.new(description)
end
end
|
#evergreen? ⇒ Boolean
185
186
187
|
# File 'lib/actv/asset.rb', line 185
def evergreen?
self.evergreenAssetFlag.downcase == 'true' rescue false
end
|
#image_by_name(name) ⇒ Object
148
149
150
|
# File 'lib/actv/asset.rb', line 148
def image_by_name(name)
self.images.find { |img| img.name.downcase == name.downcase }
end
|
#images ⇒ Object
Also known as:
asset_images, assetImages
82
83
84
85
86
|
# File 'lib/actv/asset.rb', line 82
def images
@images ||= Array(@attrs[:assetImages]).map do |img|
ACTV::AssetImage.new(img)
end
end
|
#is_article? ⇒ Boolean
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
# File 'lib/actv/asset.rb', line 166
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
if self.sourceSystem.fetch(:legacyGuid, "").upcase == "CA4EA0B1-7377-470D-B20D-BF6BEA23F040"
is_article = true
end
end
is_article
end
|
#is_event? ⇒ Boolean
157
158
159
160
161
162
163
164
|
# File 'lib/actv/asset.rb', line 157
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
68
69
70
|
# File 'lib/actv/asset.rb', line 68
def legacy_data
@legacy_data ||= ACTV::AssetLegacyData.new(@attrs[:assetLegacyData]) unless @attrs[:assetLegacyData].nil?
end
|
#org_timezone ⇒ Object
46
47
48
|
# File 'lib/actv/asset.rb', line 46
def org_timezone
@org_timezone ||= @attrs[:localTimeZoneId] unless @attrs[:localTimeZoneId].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
@place_timezone ||= place[:timezone] unless place[:timezone].nil?
end
|
#prices ⇒ Object
Also known as:
asset_prices, assetPrices
106
107
108
109
110
|
# File 'lib/actv/asset.rb', line 106
def prices
@asset_prices ||= Array(@attrs[:assetPrices]).map do |price|
ACTV::AssetPrice.new(price)
end
end
|
#regcenter2? ⇒ Boolean
193
194
195
|
# File 'lib/actv/asset.rb', line 193
def regcenter2?
self.sourceSystem[:legacyGuid].upcase == "3BF82BBE-CF88-4E8C-A56F-78F5CE87E4C6" rescue false
end
|
#regcenter? ⇒ Boolean
189
190
191
|
# File 'lib/actv/asset.rb', line 189
def regcenter?
self.sourceSystem[:legacyGuid].upcase == "EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65" rescue false
end
|
#registration_status ⇒ Object
Also known as:
reg_status
213
214
215
|
# File 'lib/actv/asset.rb', line 213
def registration_status
@registration_status ||= nil
end
|
#seo_url(systemName = 'as3') ⇒ Object
138
139
140
141
|
# File 'lib/actv/asset.rb', line 138
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
122
123
124
125
126
|
# File 'lib/actv/asset.rb', line 122
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
62
63
64
|
# File 'lib/actv/asset.rb', line 62
def status
@status ||= ACTV::AssetStatus.new(@attrs[:assetStatus]) unless @attrs[:assetStatus].nil?
end
|
#summary ⇒ Object
130
131
132
|
# File 'lib/actv/asset.rb', line 130
def summary
@summary ||= description_by_type 'summary'
end
|
#tag_by_description(description) ⇒ Object
152
153
154
155
|
# File 'lib/actv/asset.rb', line 152
def tag_by_description(description)
asset_tag = self.tags.find { |at| at.tag.description.downcase == description.downcase }
asset_tag.tag.name if asset_tag
end
|
90
91
92
93
94
|
# File 'lib/actv/asset.rb', line 90
def tags
@asset_tags ||= Array(@attrs[:assetTags]).map do |tag|
ACTV::AssetTag.new(tag)
end
end
|
#thriva? ⇒ Boolean
209
210
211
|
# File 'lib/actv/asset.rb', line 209
def thriva?
self.sourceSystem[:legacyGuid].upcase == "2BA50ABA-080E-4E3D-A01C-1B4F56648A2E" rescue false
end
|
#topics ⇒ Object
Also known as:
asset_topics, assetTopics
114
115
116
117
118
|
# File 'lib/actv/asset.rb', line 114
def topics
@asset_topics ||= Array(@attrs[:assetTopics]).map do |topic|
ACTV::AssetTopic.new(topic)
end
end
|
#version ⇒ Object
50
51
52
|
# File 'lib/actv/asset.rb', line 50
def version
@asset_version ||= @attrs[:assetVersion] unless @attrs[:assetVersion].nil?
end
|