Renaming temp variable in urlCheck:

This commit is contained in:
ruidajo 2024-05-26 13:44:40 -05:00
parent f80fe4fbc1
commit 4ede468c75
2 changed files with 16 additions and 15 deletions

View File

@ -4,15 +4,16 @@ I manage instagram URLs information.
InstagramUrl newURL: 'https://instagram.com/restOfURL'
"
Class {
#name : #InstagramUrl,
#superclass : #Object,
#name : 'InstagramUrl',
#superclass : 'Object',
#instVars : [
'url'
],
#category : #Instagram
#category : 'Instagram',
#package : 'Instagram'
}
{ #category : #'instance creation' }
{ #category : 'instance creation' }
InstagramUrl class >> newURL: url [
| instance |
instance := self new.
@ -20,7 +21,7 @@ InstagramUrl class >> newURL: url [
^ instance
]
{ #category : #initialization }
{ #category : 'initialization' }
InstagramUrl >> initialize [
| initial |
initial := 'https://www.instagram.com' asUrl.
@ -30,37 +31,37 @@ InstagramUrl >> initialize [
]
{ #category : #opening }
{ #category : 'opening' }
InstagramUrl >> openWithoutTracking [
WebBrowser openOn: self urlWithoutTracking
]
{ #category : #accessing }
{ #category : 'accessing' }
InstagramUrl >> url [
^ url
]
{ #category : #accessing }
{ #category : 'accessing' }
InstagramUrl >> url: aURL [
url := aURL
]
{ #category : #testing }
InstagramUrl >> urlCheck: aURL [
{ #category : 'testing' }
InstagramUrl >> urlCheck: aURLString [
| urlCheck |
(aURL includesSubstring: 'instagram.com')
ifFalse: [ UIManager default inform: '" ', aURL, ' " it''s not an instagram URL.'.
(aURLString includesSubstring: 'instagram.com')
ifFalse: [ UIManager default inform: '" ', aURLString, ' " it''s not an instagram URL.'.
^ self url].
urlCheck := aURL asUrl.
urlCheck := aURLString asUrl.
urlCheck hasHost ifFalse: [ urlCheck host: urlCheck segments first.
urlCheck removeFirstPathSegment. ].
urlCheck hasScheme ifFalse: [ urlCheck scheme: 'https' ].
^ urlCheck
]
{ #category : #accessing }
{ #category : 'accessing' }
InstagramUrl >> urlWithoutTracking [
^ self url queryRemoveAll; asStringOrText
]

View File

@ -1 +1 @@
Package { #name : #Instagram }
Package { #name : 'Instagram' }