Sha256: 1c262bd594ad466736c63d4342ef119fa117a76eaec02d4c8b0f8ac9ef03ba24

Contents?: true

Size: 715 Bytes

Versions: 5

Compression:

Stored size: 715 Bytes

Contents

module SoberSwag
  module Type
    ##
    # Mixin module used to identify types that should be considered
    # standalone, named types from SoberSwag's perspective.
    module Named
      ##
      # Class Methods Module.
      # Modules that include {SoberSwag::Type::Named}
      # will automatically extend this module.
      module ClassMethods
        def alias?
          false
        end

        def alias_of
          nil
        end

        def root_alias
          alias_of || self
        end

        def description(arg = nil)
          @description = arg if arg
          @description
        end
      end

      def self.included(mod)
        mod.extend(ClassMethods)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sober_swag-0.19.0 lib/sober_swag/type/named.rb
sober_swag-0.18.0 lib/sober_swag/type/named.rb
sober_swag-0.17.0 lib/sober_swag/type/named.rb
sober_swag-0.16.0 lib/sober_swag/type/named.rb
sober_swag-0.15.0 lib/sober_swag/type/named.rb