.
require GlobalEnums.rb , :
newGuy.currentContractType = ContractType::Internship
, Ruby :: ( ), .. , :: s:
module Foo
module Bar
class Baz
Qux = "quux"
end
end
end
p Foo::Bar::Baz::Qux
P.S. , , . † Ruby snake_case. CamelCase, SCREAMING_CAMEL_CASE.
, , :
module MyApp
module ContractType
UNDEFINED = 0
INTERNSHIP = 1
CLT = 2
CONTRACTOR = 4
end
end
new_guy.current_contract_type = ContractType::INTERNSHIP
† , , Integer(n) , URI(str) Nokogiri::XML(str).