Ruby on Rails Sunday, July 12, 2015

I try with this:

class Auto

attr_accessor :auto

def initialize(auto)
@modelo = modelo
@precio = precio

end

def calcular_neto(i)
for i in 0 ..i
(auto)*0.18
end
return auto

end

auto = Auto.new("Volvo", 19000)
neto = auto.calcular_neto(2)
puts " Neto: #{neto}"

=====

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/74f94cee3a088009009ff6357323e340%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment