Class: YARDGo::CodeObjects::StructObject

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

Direct Known Subclasses

BareStructObject, InterfaceObject

Instance Method Summary collapse

Instance Method Details

#implemented_interfacesObject



32
33
34
# File 'lib/yard-go/code_objects.rb', line 32

def implemented_interfaces
  YARD::Registry.all(:interface).select {|i| implements?(i) }
end

#implements?(interface) ⇒ Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/yard-go/code_objects.rb', line 36

def implements?(interface)
  interface.implemented_by?(self)
end

#inheritance_tree(include_mods = false) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/yard-go/code_objects.rb', line 23

def inheritance_tree(include_mods = false)
  list = (include_mods ? mixins(:instance) : [])
  [self] + list.map do |m|
    next m if m == self
    next m unless m.respond_to?(:inheritance_tree)
    m.inheritance_tree(include_mods)
  end.flatten.uniq
end

#scopeObject



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

def scope; :instance end

#sepObject



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

def sep; '.' end

#source_typeObject



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

def source_type; :go end

#titleObject



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

def title; namespace.title + "." + name.to_s end

#typeObject



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

def type; :struct end