Class: YARD::Tags::TypesExplainer::CollectionType

Inherits:
Type
  • Object
show all
Defined in:
lib/yard/tags/types_explainer.rb

Direct Known Subclasses

FixedCollectionType

Instance Attribute Summary collapse

Attributes inherited from Type

#name

Instance Method Summary collapse

Constructor Details

#initialize(name, types) ⇒ CollectionType

Returns a new instance of CollectionType.



61
62
63
64
# File 'lib/yard/tags/types_explainer.rb', line 61

def initialize(name, types)
  @name = name
  @types = types
end

Instance Attribute Details

#typesObject

Returns the value of attribute types.



59
60
61
# File 'lib/yard/tags/types_explainer.rb', line 59

def types
  @types
end

Instance Method Details

#to_s(_singular = true) ⇒ Object



66
67
68
# File 'lib/yard/tags/types_explainer.rb', line 66

def to_s(_singular = true)
  "a#{name[0, 1] =~ /[aeiou]/i ? 'n' : ''} #{name} of (" + list_join(types.map {|t| t.to_s(false) }) + ")"
end