Starting GitHubAsset listings for later downloading.
This commit is contained in:
parent
e5b6269547
commit
9844b266d6
56
src/ExoRepo/GitHubAsset.class.st
Normal file
56
src/ExoRepo/GitHubAsset.class.st
Normal file
@ -0,0 +1,56 @@
|
||||
Class {
|
||||
#name : #GitHubAsset,
|
||||
#superclass : #Object,
|
||||
#instVars : [
|
||||
'name',
|
||||
'created',
|
||||
'updated',
|
||||
'size',
|
||||
'downloadLink'
|
||||
],
|
||||
#category : #'ExoRepo-External'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
GitHubAsset class >> fromDictionary: aGitHubAssetDictionary [
|
||||
| response |
|
||||
response := self new
|
||||
name: (aGitHubAssetDictionary at: 'name');
|
||||
size: (aGitHubAssetDictionary at: 'size');
|
||||
created: (aGitHubAssetDictionary at: 'created_at');
|
||||
updated: (aGitHubAssetDictionary at: 'updated_at');
|
||||
downloadLink: (aGitHubAssetDictionary at: 'browser_download_url').
|
||||
^ response
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GitHubAsset >> created: anObject [
|
||||
created := anObject
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GitHubAsset >> downloadLink: anUrl [
|
||||
downloadLink := anUrl
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GitHubAsset >> name: anObject [
|
||||
name := anObject
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GitHubAsset >> printOn: aStream [
|
||||
super initialize.
|
||||
aStream
|
||||
nextPutAll: '(', name, ')'
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GitHubAsset >> size: anObject [
|
||||
size := anObject
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GitHubAsset >> updated: anObject [
|
||||
updated := anObject
|
||||
]
|
@ -12,6 +12,13 @@ GitHubWrapper class >> apiEndPoint [
|
||||
^ 'https://api.github.com/' asUrl
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GitHubWrapper >> assets [
|
||||
^ (self lastReleaseData at: 'assets') collect: [:each |
|
||||
GitHubAsset fromDictionary: each
|
||||
]
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
GitHubWrapper >> lastReleaseData [
|
||||
| releasesLink |
|
||||
|
Loading…
Reference in New Issue
Block a user