【发布时间】:2016-02-12 01:36:50
【问题描述】:
以下 Ruby 类的声明/定义中遵循的格式/语法是什么?我不明白类名中使用的冒号 (:)。这说明什么?
class ::Chef::Recipe
include ::Opscode::ChefClient::Helpers
end
这是来自here:
我熟悉以下定义 Ruby 类的方式:
class ClassName
CONSTANT = Z
....methods...
end
我知道一个常量被称为ClassName::Z,但是上面的声明方式对我来说是新的,我在哪里可以找到像这样声明一个 ruby 类的文档。
【问题讨论】:
标签: ruby chef-infra