Class: YARDGo::CodeObjects::InterfaceObject

Inherits:
StructObject
  • Object
show all
Defined in:
lib/yard-go/code_objects.rb

Instance Method Summary collapse

Methods inherited from StructObject

#implemented_interfaces, #implements?, #inheritance_tree, #scope, #title

Instance Method Details

#implemented_by?(struct) ⇒ Boolean

Returns:

  • (Boolean)


70
71
72
73
# File 'lib/yard-go/code_objects.rb', line 70

def implemented_by?(struct)
  m = struct.children.select {|t| t.type == :method && t.scope == :instance }.map(&:name)
  children.select {|t| t.type == :method && t.scope == :instance }.all? {|t| m.include?(t.name) }
end

#implementing_structsObject



75
76
77
# File 'lib/yard-go/code_objects.rb', line 75

def implementing_structs
  YARD::Registry.all(:struct).select {|s| implemented_by?(s) }
end

#sepObject



66
# File 'lib/yard-go/code_objects.rb', line 66

def sep; '.' end

#source_typeObject



68
# File 'lib/yard-go/code_objects.rb', line 68

def source_type; :go end

#typeObject



67
# File 'lib/yard-go/code_objects.rb', line 67

def type; :interface end