-
-
Save Gurpartap/f9381fb2a163837d77b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomValues | |
attr_accessor :values | |
def initialize(*values) | |
self.values = values | |
end | |
def update | |
values.each do |value| | |
yield(value) if block_given? | |
end | |
end | |
end | |
s1 = CustomValues.new(1,2,3,4,5) | |
s1.update do |value| | |
puts value | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment