Either puts "#{a}#{b}#{c}" or print a; print b; puts c

On Feb 26, 2013, at 10:55, Patric berg <lists / ruby-forum.com> wrote:

> Hello pros!
> 
> Im pretty new at Ruby and doing some toturials!
> But what i don't understand is how i get the Puts on the same line in
> the following code; I know i need to use .chop!? but were in the code?
> 
> Ty!
> 
> class Hund
> 
>    def namn (aName)
>    @myname = aName
>  end
> 
>    def skrivnamn
>      return@myname
>  end
> 
>    def color (acolor)
>      @mycolor = acolor
>  end
>    def skrivcolor
> 
>      return@mycolor
>  end
> 
>    def talk
>      return("den lter fljande Woof".center(10))
>  end
> 
> 
> 
> mydog=Hund.new
> mydog.namn("Patric berg".center(12))
> mydog.color("Min hund r rd".center(10))
> puts (mydog.skrivnamn)
> puts (mydog.skrivcolor)
> puts(mydog.talk)
> 
> yourdog=Hund.new
> yourdog.namn("Karl Svart".center(10))
> yourdog.color("Min hund r svart".center(10))
> puts (yourdog.skrivnamn)
> puts (yourdog.skrivcolor)
> puts (yourdog.talk)
> 
> 
> 
> 
> end
> 
> -- 
> Posted via http://www.ruby-forum.com/.