Starting GitHubAsset listings for later downloading.

This commit is contained in:
= 2024-05-02 11:00:36 -05:00
parent e5b6269547
commit 9844b266d6
2 changed files with 63 additions and 0 deletions

View 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
]

View File

@ -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 |