Modules vs Concerns

TypeFast
www.typefast.co/
Modules is ruby's version of the classic interface available in other programming languages.
Ruby on Rails however has something called Concerns, which look like a module but seems to be a little different to someone who may not be familiar with the differences.
In this video, I go over the main differences and similarities between module and concerns.

Пікірлер: 6

  • @stpaquet
    @stpaquet2 жыл бұрын

    the behavior in Rails is likely to have its root in the difference between include and extend. When using include you need the object to be initialized, while extend does not require the object to be initialized to call a method. I would not be surprised that in Rails the validation is taking place before the object is initialized, thus the use of extend and the include do block.

  • @williamromerovela
    @williamromerovela2 жыл бұрын

    Great video man! What a great explanation about this two features. I saw a project where modules are located on lib folder and are used as concerns.

  • @king_and_country
    @king_and_country2 жыл бұрын

    Really great videos, thank you so much!

  • @shinzhang4961
    @shinzhang49612 жыл бұрын

    Thanks

  • @ledockol
    @ledockol2 жыл бұрын

    Thanks!!!

  • @muhammadahmed1890
    @muhammadahmed18902 жыл бұрын

    Thanks