If I have in one file the following:
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
The methods property
defined with get documented properly. However, if I have in separate files these definitions the documentation is not generated properly, such as in the case as follows:
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
When in separate files the Yard macros do not carry over when the documentation is generated. How does one enable this?