class MyClass
def a_method
...
end
def b_method
Technology.new do |t|
a_method()
end
end
end
# Technology
class Technology
attr_accessor :val
def initialize
@val = 42
yield self
end
end
# MyClass2
class MyClass
# @param [Integer] val
# @return [NilClass]
def a_method(val)
puts val
end
# @return [NilClass]
def b_method
Technology.new do |technology|
a_method technology.val
end
end
end
my_class = MyClass.new
my_class.b_method # => 42