Class: Z3::Printer::PrintedExpr

Inherits:
Object
  • Object
show all
Defined in:
lib/z3/printer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str, priority = false) ⇒ PrintedExpr

Returns a new instance of PrintedExpr.



11
12
13
14
# File 'lib/z3/printer.rb', line 11

def initialize(str, priority=false)
  @str = str
  @priority = priority
end

Instance Attribute Details

#priorityObject (readonly)

Returns the value of attribute priority.



10
11
12
# File 'lib/z3/printer.rb', line 10

def priority
  @priority
end

#strObject (readonly)

Returns the value of attribute str.



10
11
12
# File 'lib/z3/printer.rb', line 10

def str
  @str
end

Instance Method Details

#enforce_parenthesesObject



18
19
20
21
22
23
24
# File 'lib/z3/printer.rb', line 18

def enforce_parentheses
  if @priority
    "(#{@str})"
  else
    @str
  end
end

#to_sObject



15
16
17
# File 'lib/z3/printer.rb', line 15

def to_s
  @str
end