Ruby on Rails Sunday, July 12, 2015

Point taken, however I beg to differ...  However novice in ROR folks maybe, I think that they bring significance in background.  As an educator I have found that appealing to more advanced notions, may be effective.  We just have different styles.

From the get go all you needed to suggest was:

class Auto

 attr_accessor :auto01, :auto02

  def initialize(auto01_value,auto02_value)
  @auto01 = auto01_value
  @auto02 = auto02_value
  end

  def calcular_neto
     (self.auto01 + self.auto02)*0.18 + self.auto01 + self.auto02
  end

end

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

Then you could point out that car Model was not considered

Liz  

--
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/f034df0a-d630-4d0a-8e2b-98d3dd2691c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment