Search code examples
rubycapistrano

Capistrano or Ruby feature


I was reading through this article, because I am currently learning Capistrano.

I found this line on this page:

set :deploy_to, '/var/www/my_app_name'

I am not sure if this is a Ruby feature or a Capistrano feature.

I checked Ruby for sets but it only has the datastructure Set(s).

I don't think this is a datastructure like set.

This looks like a key-value pair or a hash table where the value(s) right after the keyword set is the key and the string/value after the , is the value of the key-value pair/hash table (field).

Is this a Ruby feature or a Capistrano feature? What is the name of this particular feature?


Solution

  • This is a Ruby feature. It is called a "message send". If you are familiar with other languages, they call it a "subroutine call", "method call", "function call", "function application", "procedure call", or similar.

    More precisely, it is a receiverless message send to the implicit receiver self with two arguments, the first being the symbol literal :deploy_to, the second being the string literal '/var/www/my_app_name'.