Class: Ziya::Gauges::Base

Inherits:
Object
  • Object
show all
Includes:
Helpers::BaseHelper
Defined in:
lib/ziya/gauges/base.rb

Direct Known Subclasses

Radial, Support::Area, Thermo

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Constructor Details

#initialize(license, design_id) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ziya/gauges/base.rb', line 9

def initialize( license, design_id )
  @license   = license
  @design_id = design_id
  
  # load up associated helper
  loaded = load_helper( Ziya.helpers_dir ) if Ziya.helpers_dir
  Ziya.logger.warn( ">>> ZiYa -- no helper for gauge `#{design_id}" ) unless loaded

  # init defaults
  @options = default_options      
end

Instance Attribute Details

#componentsObject (readonly)

Returns the value of attribute components.



6
7
8
# File 'lib/ziya/gauges/base.rb', line 6

def components
  @components
end

#design_idObject

Returns the value of attribute design_id.



5
6
7
# File 'lib/ziya/gauges/base.rb', line 5

def design_id
  @design_id
end

#licenseObject

Returns the value of attribute license.



5
6
7
# File 'lib/ziya/gauges/base.rb', line 5

def license
  @license
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/ziya/gauges/base.rb', line 7

def options
  @options
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/ziya/gauges/base.rb', line 6

def type
  @type
end

Instance Method Details

#set_preferences(opts = {}) ⇒ Object


provides for overiding basic functionality

gauge_color

Legend color

legend_color

Gauge color



26
27
28
# File 'lib/ziya/gauges/base.rb', line 26

def set_preferences( opts={} )
  options.merge!( opts )
end

#to_xmlObject


render gauge to xml



32
33
34
# File 'lib/ziya/gauges/base.rb', line 32

def to_xml
  render_xml
end