Method: YARD::CodeObjects::NamespaceObject#included_meths
- Defined in:
- lib/yard/code_objects/namespace_object.rb
#included_meths(opts = {}) ⇒ Object
Returns methods included from any mixins that match the attributes specified by opts
. If no options are specified, returns all included methods.
144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/yard/code_objects/namespace_object.rb', line 144 def included_meths(opts = {}) opts = SymbolHash[:scope => [:instance, :class]].update(opts) [opts[:scope]].flatten.map do |scope| mixins(scope).inject([]) do |list, mixin| next list if mixin.is_a?(Proxy) arr = mixin.meths(opts.merge(:scope => :instance)).reject do |o| next false if opts[:all] child(:name => o.name, :scope => scope) || list.find {|o2| o2.name == o.name } end arr.map! {|o| ExtendedMethodObject.new(o) } if scope == :class list + arr end end.flatten end |