Class: GraphViz::Types::ColorList

Inherits:
Common show all
Defined in:
lib/graphviz/types/color_list.rb

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from GraphViz::Types::Common

Instance Method Details

#check(data) ⇒ Object


4
5
6
7
8
9
10
# File 'lib/graphviz/types/color_list.rb', line 4

def check(data)
  data = data.to_s if data.is_a?(Symbol)
  return nil if data.empty?

  @to_ruby = data.split(/\s*:\s*/).map { |c| GraphViz::Types::Color.new(c).to_ruby }
  return data
end

#outputObject Also known as: to_gv, to_s


12
13
14
# File 'lib/graphviz/types/color_list.rb', line 12

def output
  return @data.to_s.inspect.gsub( "\\\\", "\\" )
end

#to_rubyObject


19
20
21
# File 'lib/graphviz/types/color_list.rb', line 19

def to_ruby
   @data
end