Module: SoberSwag::Type::Named::ClassMethods

Defined in:
lib/sober_swag/type/named.rb

Overview

Class Methods Module. Modules that include SoberSwag::Type::Named will automatically extend this module.

Instance Method Summary collapse

Instance Method Details

#alias?Boolean

Is this type a "wrapper" for another type?

Returns:

  • (Boolean)


14
15
16
# File 'lib/sober_swag/type/named.rb', line 14

def alias?
  false
end

#alias_ofObject

The type this type is a wrapper for



20
21
22
# File 'lib/sober_swag/type/named.rb', line 20

def alias_of
  nil
end

#descriptionString #description(arg) ⇒ String

Overloads:

  • #descriptionString

    Returns a human-readable description of this type.

    Returns:

    • (String)

      a human-readable description of this type

  • #description(arg) ⇒ String

    Returns arg.

    Parameters:

    • arg (String)

      a human-readable description of this type

    Returns:

    • (String)

      arg



36
37
38
39
# File 'lib/sober_swag/type/named.rb', line 36

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

#root_aliasObject

The "root" type along the alias chain



26
27
28
# File 'lib/sober_swag/type/named.rb', line 26

def root_alias
  alias_of || self
end