# What does this mean?

**URL:** <https://www.ruby-forum.com/t/what-does-this-mean/60069>\
**Category:** Rails\
**Created:** [May 9, 2006, 11:06pm UTC](https://www.ruby-forum.com/t/what-does-this-mean/60069 "2006-05-09T23:06:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [May 9, 2006, 11:06pm UTC](https://www.ruby-forum.com/t/what-does-this-mean/60069/1 "2006-05-09T23:06:54Z")

</div>

def cas  
casses = [@cas.ss,@cas.s,@cas.xl,@cas.l,@cas.m,@cas.w,@cas.xw]  
casses.each do |cas|  
if cas \>= 10  
@user.send(cas) -= 1  
@user.save!  
end  
end

my error:  
app/controllers/battle\_controller.rb:383: parse error, unexpected  
tOP\_ASGN, expecting kEND  
@user.send(cas) -= 1  
^  
app/controllers/battle\_controller.rb:388: parse error, unexpected $,  
expecting kEND

---

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [May 9, 2006, 11:31pm UTC](https://www.ruby-forum.com/t/what-does-this-mean/60069/2 "2006-05-09T23:31:03Z")

</div>

You’re missing an end. You should have three ends, one for the if,  
one for the do, one for the def.

def cas  
casses = [@cas.ss,@cas.s,@cas.xl,@cas.l,@cas.m,@cas.w,@cas.xw]  
casses.each do |cas|  
if cas \>= 10  
@user.send(cas) -= 1  
@user.save!  
end  
end  
end

Michael

---

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [May 9, 2006, 11:34pm UTC](https://www.ruby-forum.com/t/what-does-this-mean/60069/3 "2006-05-09T23:34:44Z")

</div>

Michael T. wrote:

> You’re missing an end. You should have three ends, one for the if,  
> one for the do, one for the def.
> 
> def cas  
> casses = [@cas.ss,@cas.s,@cas.xl,@cas.l,@cas.m,@cas.w,@cas.xw]  
> casses.each do |cas|  
> if cas \>= 10  
> @user.send(cas) -= 1  
> @user.save!  
> end  
> end  
> end
> 
> Michael

That got rid of the bottom part but I still have a problem with  
@user.send(cas) -= 1

---

<div class="post-metadata">

**Author:** ![mohammad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mohammad](https://www.ruby-forum.com/u/mohammad)\
**Post date:** [May 20, 2006, 4:19pm UTC](https://www.ruby-forum.com/t/what-does-this-mean/60069/4 "2006-05-20T16:19:28Z")

</div>

Mohammad, you wrote,

> > ```
> > end
> > 
> > ```
> > 
> > end  
> > end
> > 
> > Michael
> 
> That got rid of the bottom part but I still have a problem with  
> @user.send(cas) -= 1

This probably is caused because the send method on your @user class is  
not a  
valid LHS, so you cannot assign to it.
