142 lines
2.9 KiB
Smalltalk
142 lines
2.9 KiB
Smalltalk
Class {
|
|
#name : #VideoChannel,
|
|
#superclass : #Object,
|
|
#instVars : [
|
|
'author',
|
|
'authorId',
|
|
'authorBanners',
|
|
'authorThumbnails',
|
|
'relatedChannels',
|
|
'description',
|
|
'subscribersCount',
|
|
'totalViews',
|
|
'isFamilyFriendly',
|
|
'latestVideos'
|
|
],
|
|
#category : #VideoWeb
|
|
}
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> author [
|
|
^ author
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> author: anObject [
|
|
author := anObject
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> authorBanners [
|
|
^ authorBanners
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> authorBanners: anObject [
|
|
authorBanners := anObject
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> authorId [
|
|
^ authorId
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> authorId: anObject [
|
|
authorId := anObject
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> authorThumbnails [
|
|
^ authorThumbnails
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> authorThumbnails: anObject [
|
|
authorThumbnails := anObject
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> description [
|
|
^ description
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> description: anObject [
|
|
description := anObject
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> fromDictionary: aDictionary [
|
|
| lastestVideosArray |
|
|
self author: (aDictionary at: 'author');
|
|
authorId: (aDictionary at: 'authorId');
|
|
authorThumbnails: (aDictionary at: 'authorThumbnails');
|
|
description: (aDictionary at: 'description');
|
|
isFamilyFriendly: (aDictionary at: 'isFamilyFriendly');
|
|
relatedChannels: (aDictionary at: 'relatedChannels');
|
|
subscribersCount: (aDictionary at: 'subCount');
|
|
totalViews: (aDictionary at: 'totalViews').
|
|
lastestVideosArray := (aDictionary at: 'latestVideos' ).
|
|
lastestVideosArray do: [ :videoData |
|
|
self latestVideos add: (WebVideo new fromDictionary: videoData ) ].
|
|
^ self
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> isFamilyFriendly [
|
|
^ isFamilyFriendly
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> isFamilyFriendly: anObject [
|
|
isFamilyFriendly := anObject
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> latestVideos [
|
|
^ latestVideos ifNil: [ latestVideos := OrderedCollection new]
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> latestVideos: anObject [
|
|
latestVideos := anObject
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> printOn: aStream [
|
|
super printOn: aStream.
|
|
aStream
|
|
nextPutAll: ' ( ', self author, ' | ', self authorId, ' | ', self description, ' )'
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> relatedChannels [
|
|
^ relatedChannels
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> relatedChannels: anObject [
|
|
relatedChannels := anObject
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> subscribersCount [
|
|
^ subscribersCount
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> subscribersCount: anObject [
|
|
subscribersCount := anObject
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> totalViews [
|
|
^ totalViews
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
VideoChannel >> totalViews: anObject [
|
|
totalViews := anObject
|
|
]
|