Class: Taipo::TypeElements Private
- Inherits:
-
Array
- Object
- Array
- Taipo::TypeElements
- Defined in:
- lib/taipo/type_elements.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A set of TypeElement objects
Instance Method Summary collapse
-
#initialize(els = nil) ⇒ TypeElements
constructor
private
Initialize a new set of TypeElement.
-
#to_s ⇒ String
private
Return the String representation of this object.
Constructor Details
#initialize(els = nil) ⇒ TypeElements
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a new set of Taipo::TypeElement
17 18 19 |
# File 'lib/taipo/type_elements.rb', line 17 def initialize(els = nil) els&.each { |el| self.push el } end |
Instance Method Details
#to_s ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return the String representation of this object
27 28 29 30 31 |
# File 'lib/taipo/type_elements.rb', line 27 def to_s self.reduce('') do |memo,el| (memo == '') ? el.to_s : memo + '|' + el.to_s end end |