Class: Taipo::TypeElement::Constraints Private
- Inherits:
-
Array
- Object
- Array
- Taipo::TypeElement::Constraints
- Defined in:
- lib/taipo/type_element/constraints.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 Constraint objects
Instance Method Summary collapse
-
#initialize(constraints = nil) ⇒ Constraints
constructor
private
Initialize a new set of Constraint.
-
#to_s ⇒ String
private
Return the String representation of this object.
Constructor Details
#initialize(constraints = nil) ⇒ Constraints
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::Constraint
17 18 19 |
# File 'lib/taipo/type_element/constraints.rb', line 17 def initialize(constraints = nil) constraints&.each { |c| self.push c } 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 32 |
# File 'lib/taipo/type_element/constraints.rb', line 27 def to_s inner = self.reduce('') do |memo,c| (memo == '') ? c.to_s : memo + ',' + c.to_s end '(' + inner + ')' end |