Ruby

Query on Module

I am new to Ruby and was going through some tutorials, where I come with the following code

module DecimalCode RED = "rgb(255,0,0)" GREEN = "rgb(0,128,0)"

def code return "RED : Decimal code #{RED}" end

def DecimalCode.code return "GREEN : Decimal code #{GREEN}" end

def hello return "Hello world!" end

end

include DecimalCode puts DecimalCode.hello puts DecimalCode.code

My queries

  1. What is the difference between the methods "code" and "DecimalCode.code"
  2. When I do not include the module and type "puts DecimalCode.code" it always prints Green: Decimal code, why is that so?