# What's the meaning of "\<\<"

**URL:** <https://www.ruby-forum.com/t/whats-the-meaning-of/132970>\
**Category:** Rails\
**Created:** [March 26, 2008, 10:13am UTC](https://www.ruby-forum.com/t/whats-the-meaning-of/132970 "2008-03-26T10:13:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c0e974/32.png) [@kran](https://www.ruby-forum.com/u/kran)\
**Post date:** [March 26, 2008, 10:13am UTC](https://www.ruby-forum.com/t/whats-the-meaning-of/132970/1 "2008-03-26T10:13:41Z")

</div>

```
 # File activerecord/lib/active_record/validations.rb, line 327

```

327: def validate(\*methods, &block)  
328: methods \<\< block if block\_given?  
329: write\_inheritable\_set(:validate, methods)  
330: end

there is an example:  
class Comment \< ActiveRecord::Base  
validate do |comment|  
comment.must\_be\_friends  
end

```
def must_be_friends
  errors.add_to_base("Must be friends to leave a comment") unless

```

commenter.friend\_of?(commentee)  
end  
end  
Understand how this matterï¼Ÿ

---

<div class="post-metadata">

**Author:** ![kran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/c0e974/32.png) [@kran](https://www.ruby-forum.com/u/kran)\
**Post date:** [March 26, 2008, 11:09am UTC](https://www.ruby-forum.com/t/whats-the-meaning-of/132970/2 "2008-03-26T11:09:27Z")

</div>

On 26 Mar 2008, at 09:13, Cai Guichao wrote:

> ```
> # File activerecord/lib/active_record/validations.rb, line 327
> 
> ```
> 
> 327: def validate(\*methods, &block)  
> 328: methods \<\< block if block\_given?  
> 329: write\_inheritable\_set(:validate, methods)  
> 330: end

On an array \<\< is just append. Why do you ask ?

Fred
