Class: Ziya::Gauges::Support::Base
- Inherits:
-
Charts::Support::Base
- Object
- Charts::Support::Base
- Ziya::Gauges::Support::Base
- Includes:
- YamlHelpers::Gauges
- Defined in:
- lib/ziya/gauges/support/base.rb
Direct Known Subclasses
Circle, Design, Image, Line, Link, Move, Point, Polygon, RadialBase, Rect, Rotate, Scale, Text, Update
Instance Method Summary collapse
-
#to_comp_yaml(name, indent_multiplier = 1) ⇒ Object
———————————————————————– converts component to yaml style component for yaml parser consumption.
Methods included from YamlHelpers::Gauges
Methods included from YamlHelpers::Base
Methods inherited from Charts::Support::Base
#==, attributes, #attributes_for, #configured?, #flatten, has_attribute, #has_sub_components, #initialize, #merge, #options, #options_as_string
Constructor Details
This class inherits a constructor from Ziya::Charts::Support::Base
Instance Method Details
#to_comp_yaml(name, indent_multiplier = 1) ⇒ Object
converts component to yaml style component for yaml parser consumption
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ziya/gauges/support/base.rb', line 7 def to_comp_yaml( name, indent_multiplier=1 ) buff = [] tab = indent( indent_multiplier ) buff << "#{dial( self.class.name.ziya_demodulize, name )}" .each_pair do |k,v| if v.is_a? YAML::Omap buff << "#{tab}#{indent}#{dials}" v.each do |comp_name, comp| buff << "#{tab}#{indent(2)}#{dial( comp.class.name.ziya_demodulize, comp_name )}" comp..each_pair { |key,val| buff << "#{tab}#{indent(4)}#{key}: #{val}"} end else buff << "#{tab}#{indent(1)}#{k}: #{v}" if [k] and ![k].to_s.empty? end end buff.join( "\n" ) end |