class GraphViz::Types::GvBool

Constants

BOOL_FALSE
BOOL_TRUE

Public Instance Methods

check(data) click to toggle source
# File lib/graphviz/types/gv_bool.rb, line 23
def check(data)
   if true == data or (data.is_a?(Integer) and data != 0) or (data.is_a?(String) and !BOOL_FALSE.include?(data.downcase))
      @to_ruby = true
      return data
   end

   if false == data or (data.is_a?(Integer) and data == 0) or (data.is_a?(String) and BOOL_FALSE.include?(data.downcase))
      @to_ruby = false
      return data
   end

   raise BoolException, "Invalid bool value"
end
output() click to toggle source
# File lib/graphviz/types/gv_bool.rb, line 37
def output
   return @data.to_s.inspect.gsub( "\\\\", "\\" )
end
Also aliased as: to_gv, to_s
to_gv()
Alias for: output
to_ruby() click to toggle source
# File lib/graphviz/types/gv_bool.rb, line 44
def to_ruby
   @to_ruby
end
to_s()
Alias for: output