newFromAccessors: aCollection ofObject: anObject
        "Performs supplied accessors on anObject
        and returns my instance with accessor -> result pairs."

^ self newFrom: (aCollection collect: [ :each | each -> (anObject perform: each) ])

"I use it for example in this piece of code:
  NeoJSONObject
    newFromAccessors: #(good bad)
    ofObject: self dao sumOfAllAnswers
"

Reply via email to