Ruby gotchas Part 1
23-Dec-2019 2594
Duck-typed means an object is considered a "Duck" if it has methods of a duck: it walks like a duck, it quacks like a duck.For example, if 123 has odd? and even? methods, then it must be an Integer?! Use respond_to? to check whether an object is able to do / has something, instead of using .methods everytime.
Ruby gotchas Part 1 #ruby #rubydeveloper #rubyonrails #gotchas https://rubyonrails.ba/link/ruby-gotchas-part-1