DEV Community

loading...

Discussion on: AYDT - 03 ( Are You Doing This ❓ ) - Programming and Cases.

Collapse
vinylimaz profile image
Vinicius Amorim de Lima

Great article!
Only to remember, the last statement is always the return in a Ruby method, so you don't need to explicit call it! That's a endorsed behavior in famous style guides (github.com/rubocop-hq/ruby-style-g...)
So we can write:

# This is a ruby file containing a function called first_omnitrix.

module AzmuthFromOmniverse

  NO_HARM = '0'
  IS_HARMFUL = '1'

  def first_omnitrix(person)
    IS_HARMFUL if person!= 'ben'
  end
end

# Example method

def first_omnitrix
  'true'
end

# Example of Capital case

module AzmuthFromOmniverse

  IS_HARMFUL = '1'

  def first_omnitrix
    IS_HARMFUL
  end
end
Collapse
chintukarthi profile image
Karthikeyan Dhanapal Author

Hey Vinicius Amorim de Lima,

Actually, I left that as a hint to cover these as a separate segment in the next article. 😅
But, I really appreciate your effort in mentioning these 😇. Keep reading.

Forem Open with the Forem app