1つのファイルに次のようなものがある場合:
module Something
class Resource
# Defines a new property
# @param [String] name the property name
# @param [Class] type the property's type
# @macro [attach] property
# @return [$2] the $1 property
def self.property(name, type) end
end
class Post < Resource
property :title, String
property :view_count, Integer
end
end
getで定義されたメソッドproperty
は適切に文書化されています。ただし、次の場合のように、これらの定義が別々のファイルにある場合、ドキュメントは適切に生成されません。
file0.rb
:
require 'file1.rb'
require 'file2.rb'
file1.rb
:
module Something
class Resource
# Defines a new property
# @param [String] name the property name
# @param [Class] type the property's type
# @macro [attach] property
# @return [$2] the $1 property
def self.property(name, type) end
end
end
file2.rb
:
module Something
class Post < Resource
property :title, String
property :view_count, Integer
end
end
別のファイルにある場合、ドキュメントが生成されるときにヤードマクロは引き継がれません。これをどのように有効にしますか?