Skip to content

Commit

Permalink
Added getter for linkCondition variable, with initialisation in class…
Browse files Browse the repository at this point in the history
… RFCondition
  • Loading branch information
dupriezt committed Jan 29, 2021
1 parent 8acbeea commit d6b4ba0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Reflectivity/RFCondition.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RFCondition >> cull: arguments [
"in case of my wrapped link expects arguments"

^ condition
and: [ linkCondition perform: linkCondition valueSelector withArguments: {arguments} ]
and: [ self linkCondition perform: self linkCondition valueSelector withArguments: {arguments} ]
]

{ #category : #'enable/disable' }
Expand All @@ -50,6 +50,11 @@ RFCondition >> initialize [
condition := true
]

{ #category : #accessing }
RFCondition >> linkCondition [
^ linkCondition ifNil: [ linkCondition := [ true ] ].
]

{ #category : #accessing }
RFCondition >> linkCondition: aBlockOrBoolean [
linkCondition := aBlockOrBoolean
Expand All @@ -63,12 +68,12 @@ RFCondition >> reifications [

{ #category : #evaluating }
RFCondition >> value [
^condition and: [ linkCondition value ]
^condition and: [ self linkCondition value ]
]

{ #category : #accessing }
RFCondition >> valueSelector [
^ linkCondition numArgs isZero
^ self linkCondition numArgs isZero
ifTrue: [ #value ]
ifFalse: [ #cull: ]
]

0 comments on commit d6b4ba0

Please sign in to comment.