Modular Code Organization

Поділитися
Вставка
  • Опубліковано 1 лют 2025

КОМЕНТАРІ • 20

  • @iliatalebzade8751
    @iliatalebzade8751 2 роки тому +8

    I never though someday I would see Adam Driver teach ruby modules and yet here we are...
    thanks for the amazing content and keep up the good work!

  • @gorgolyt
    @gorgolyt 2 роки тому +10

    Didn't know Kylo was into programming.

    • @aarona3144
      @aarona3144 2 роки тому +1

      I was gonna say 😆

    • @collinjilbert
      @collinjilbert 2 роки тому +4

      I'm pretty good with a force push

    • @aarona3144
      @aarona3144 2 роки тому +1

      @@collinjilbert 😆👍

  • @cristianchable7739
    @cristianchable7739 2 роки тому +1

    Great video!
    Regards from Mérida, Yucatán, México.

    • @collinjilbert
      @collinjilbert 2 роки тому +1

      Thank you so much, Cristian! I appreciate it very much.

    • @cristianchable7739
      @cristianchable7739 2 роки тому +1

      @@collinjilbert I'm back end developer and i was searching videos to be better and create clean code and organize my code. Your videos help me a lot with this.
      Thank you Collin.

    • @collinjilbert
      @collinjilbert 2 роки тому +1

      @@cristianchable7739 Awesome! I'm glad you found it helpful/useful. Thank you so much for watching!! :)

  • @NomenNescio99
    @NomenNescio99 2 роки тому +1

    Great tutorial, I got inspired and learned stuff. 👍

    • @collinjilbert
      @collinjilbert 2 роки тому

      That's awesome! Glad to hear both of those things! Thanks for watching! :)

  • @developerfoe
    @developerfoe 2 роки тому +1

    couldn't blink my eyes while watching your videos .... just too busy to learn new things

    • @collinjilbert
      @collinjilbert 2 роки тому +2

      I'm not sure if this is a good comment or not lol

  • @elcanalitodecito2332
    @elcanalitodecito2332 2 роки тому +1

    i got a little confused from the example, if i want to modularize instance methods would it be possible?

    • @collinjilbert
      @collinjilbert 2 роки тому +3

      If you extend self in the module and then include (not extend) that module in another class, then the methods in the module will be available to instances of the including class while still allowing the methods in the module to be callable on the module itself. Example:
      module Foo
      extend self
      def say_hello
      p "Hello, world"
      end
      end
      Foo.say_hello
      #=> "Hello, world"
      class Bar
      include Foo
      end
      Bar.new.say_hello
      #=> "Hello, world"
      Alternatively, if you extend the module inside another class, then the methods will be available to the class itself just as they are on the module.
      class Baz
      extend Foo
      end
      Baz.say_hello
      #=> "Hello, world"
      Hope that helps!

  • @hel12484
    @hel12484 2 роки тому +1

    Kylo, Undercover developer

  • @aeroplane769
    @aeroplane769 2 роки тому +1

    Didn't know it, thanks

  • @azizdevfull
    @azizdevfull 2 роки тому +1

    I didnt know