Class: Ziya::Gauges::Support::Base
- Inherits:
-
Components::Base
- Object
- Components::Base
- Ziya::Gauges::Support::Base
- Includes:
- Helpers::BaseHelper
- 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 Helpers::BaseHelper
#chart, #chart_url, #clazz, #component, #dial, #dials, #drawing, #gauge, #indent
Methods included from Utils::Text
#camelize, #classify, #demodulize, #underscore
Methods included from Helper
#block_is_within_action_view?, #capture_block, #chart_path, #charts_swf, #class_id, #codebase, #composite_url, #content_tag, #content_tag_string, #escape_chars, #escape_once, #escape_url, #gauge_path, #gauges_swf, #gen_composite_path, #gen_swf_path, #generate_flash_tag, #generate_old_style_flash_tag, #mime, #plugin_url, #setup_movie_size, #setup_wmode, #tag, #tag_options, #ziya_chart, #ziya_chart_js, #ziya_gauge, #ziya_javascript_include_tag
Methods inherited from Components::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::Components::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 24 25 26 27 28 29 30 31 |
# File 'lib/ziya/gauges/support/base.rb', line 7 def to_comp_yaml( name, indent_multiplier=1 ) buff = [] tab = indent( indent_multiplier ) buff << "#{dial( demodulize( self.class.name ), name )}" .each_pair do |k,v| if v.is_a? YAML::Omap buff << "#{tab}#{indent}#{dials}" v.each do |name, comp| buff << "#{tab}#{indent(2)}#{dial( demodulize(comp.class.name), name )}" comp..each_pair { |k,v| buff << "#{tab}#{indent(4)}#{k}: #{v}"} end else buff << "#{tab}#{indent(1)}#{k}: #{v}" if [k] and ![k].to_s.empty? end end # if ( self.respond_to? :dials ) # buff << "#{tab}dials:" # for dial in dials do # buff << "#{tab}#{dial( demodulize( dial.class.name ) )}" # dial.options.each_pair { |k,v| buff << "#{tab}#{tab}#{k}: #{v}"} # end # end buff.join( "\n" ) end |