enforces data encapsulation in vool tree
gets rid of attraccessor
This commit is contained in:
@ -1,11 +1,17 @@
|
||||
module Vool
|
||||
class IfStatement < Statement
|
||||
attr_accessor :condition , :if_true , :if_false
|
||||
attr_reader :condition , :if_true , :if_false
|
||||
|
||||
def initialize( cond = nil)
|
||||
def initialize( cond , if_true , if_false = [])
|
||||
@condition = cond
|
||||
@if_true = []
|
||||
@if_false = []
|
||||
@if_true = if_true
|
||||
@if_false = if_false
|
||||
simplify_condition
|
||||
end
|
||||
|
||||
def simplify_condition
|
||||
return unless @condition.is_a?(ScopeStatement)
|
||||
@condition = @condition.first if @condition.single?
|
||||
end
|
||||
|
||||
def has_false?
|
||||
|
Reference in New Issue
Block a user