Sha256: 6f8b26bdf1cf33b3d8c0e09e951f2c8d1be2e3ce2ecdd336f5754ea8ed78f0b8

Contents?: true

Size: 1.08 KB

Versions: 36

Compression:

Stored size: 1.08 KB

Contents

module Inch
  module CodeObject
    module Provider
      module YARD
        module Object
          # a namespace object can have methods and other namespace objects
          # inside itself (e.g. classes and modules)
          class NamespaceObject < Base
            def attributes
              object.class_attributes.values + object.instance_attributes.values
            end

            def children_fullnames
              children.map(&:fullname)
            end

            def namespace?
              true
            end

            def has_methods?
              children.any?(&:method?)
            end

            def pure_namespace?
              children.all?(&:namespace?)
            end

            # called by MethodObject#getter?
            def child(name)
              if children
                children.detect { |child| child.name == name }
              end
            end

            def children
              object.children.map do |o|
                YARD::Object.for(o)
              end
            end

          end
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
inch-0.5.0.rc3 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.5.0.rc2 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.5.0.rc1 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.6 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.5 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.4 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.4.rc4 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.4.rc3 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.4.rc2 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.4.rc1 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.3 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.3.rc2 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.3.rc1 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.2 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.1 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.0 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.0.rc3 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.0.rc2 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.4.0.rc1 lib/inch/code_object/provider/yard/object/namespace_object.rb
inch-0.3.4.rc1 lib/inch/code_object/provider/yard/object/namespace_object.rb