锚点 & 和别名 * , 可以用来引用
defaults: &defaults adapter: postgres host: localhost development: database: myapp_development, <<: *defaults test: database: myapp_test, <<: *defaults
相当于
defaults: adapter: postgres host: localhost development: database: myapp_development, adapter: postgres host: localhost test: database: myapp_test, adapter: postgres host: localhost&用来建立锚点(defaults),<<表示合并到当前数据,*用来引用锚点。
下面另外一个例子
- &showell Steve - Clark - Brian - Oren - *showell转为JavaScript
[ 'Steve', 'Clark', 'Brian', 'Oren', 'Steve' ]