rubyx/lib/mom/statement/statements.rb

21 lines
443 B
Ruby
Raw Normal View History

module Mom
class Statements < Statement
include Common::Statements
def flatten( options = {} )
flat = @statements.shift.flatten(options)
while( nekst = @statements.shift )
flat.append nekst.flatten(options)
2017-09-08 12:12:24 +02:00
end
flat
end
2017-09-08 12:12:24 +02:00
def initialize(arr)
super(arr)
arr.each {|s|
raise "Not a Statement #{s}" unless s.is_a?( Statement) or s.is_a?(Instruction)
}
end
end
end