Class: ConlangWordGenerator::Append
- Inherits:
-
Object
- Object
- ConlangWordGenerator::Append
- Defined in:
- lib/conlang/operators.rb
Instance Method Summary collapse
- #+(other) ⇒ Object
-
#initialize(*sets) ⇒ Append
constructor
A new instance of Append.
- #sample ⇒ Object
Constructor Details
#initialize(*sets) ⇒ Append
Returns a new instance of Append.
49 50 51 |
# File 'lib/conlang/operators.rb', line 49 def initialize(*sets) @sets = sets end |
Instance Method Details
#+(other) ⇒ Object
61 62 63 |
# File 'lib/conlang/operators.rb', line 61 def +(other) Append.new(self, other) end |
#sample ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/conlang/operators.rb', line 53 def sample result = "" @sets.each { |item| result += item.sample } result end |