Skip to content

Instantly share code, notes, and snippets.

@brixen
Last active February 27, 2018 21:48
Show Gist options
  • Save brixen/4404d4a1d2e6682a0cf283d13cedf2bd to your computer and use it in GitHub Desktop.
Save brixen/4404d4a1d2e6682a0cf283d13cedf2bd to your computer and use it in GitHub Desktop.
class A
attr_accessor :things
def initialize
@things = []
end
def compute
things.each do |x|
x.compute
end
end
def result
x = compute
# do something with x
x
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment