I'm just wondering if there is any more beautiful method to create object in the method and return it ?
Here is my code:
class Example
def Example.load_from_file(filename)
example = Example.new
# some code
example
end
end
May be there is some Ruby idiom which allow me not to write example at the end of the method. Can you refactore this code or it is goog enough now ?