Class: ConlangWordGenerator::Append

Inherits:
Object
  • Object
show all
Defined in:
lib/conlang/operators.rb

Instance Method Summary collapse

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

#sampleObject



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