Method: YARD::CodeObjects::NamespaceObject#meths
- Defined in:
- lib/yard/code_objects/namespace_object.rb
#meths(opts = {}) ⇒ Array<MethodObject>
Returns all methods that match the attributes specified by opts
. If no options are provided, returns all methods.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/yard/code_objects/namespace_object.rb', line 113 def meths(opts = {}) opts = SymbolHash[ :visibility => [:public, :private, :protected], :scope => [:class, :instance], :included => true ].update(opts) opts[:visibility] = [opts[:visibility]].flatten opts[:scope] = [opts[:scope]].flatten ourmeths = children.select do |o| o.is_a?(MethodObject) && opts[:visibility].include?(o.visibility) && opts[:scope].include?(o.scope) end ourmeths + (opts[:included] ? included_meths(opts) : []) end |