summaryrefslogtreecommitdiffhomepage
path: root/lib/yard/mruby/code_objects/header_object.rb
blob: 59f67a30f718b63799ae7ce06b3b959a931b7a8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module YARD::MRuby::CodeObjects

  # A HeaderObject represents a MRuby header inside an include directory
  # It groups C Functions and define macros.
  class HeaderObject < YARD::CodeObjects::NamespaceObject
    def initialize(*args)
      super

      raise "Invalid Header" unless self.title.match(/\.h$/)
    end

    def functions
      children.find_all {|d| d.is_a?(FunctionObject) } 
    end

    def path
      self.name
    end

    def title
      super.to_s
    end

    def inheritance_tree(*args)
      return [self]
    end
  end
end