Sha256: f482b8678d9137116625ae84000198a091a49284a2765d59768777287dbf0605

Contents?: true

Size: 1.15 KB

Versions: 34

Compression:

Stored size: 1.15 KB

Contents

module Inch
  module Language
    module Ruby
      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)
                children.find { |child| child.name == name } if children
              end

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

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
inch-0.9.0.rc1 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.8.0 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.8.0.rc2 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.8.0.rc1 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.7.1 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.7.0 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.6.4 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.6.3 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.6.2 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.6.1 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.6.0 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.6.0.rc6 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.6.0.rc5 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.6.0.rc4 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.6.0.rc3 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.6.0.rc2 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.6.0.rc1 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.5.10 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.5.9 lib/inch/language/ruby/provider/yard/object/namespace_object.rb
inch-0.5.8 lib/inch/language/ruby/provider/yard/object/namespace_object.rb