Class: Ziya::Gauges::Base

Inherits:
Object
  • Object
show all
Includes:
HtmlHelpers::Gauges, YamlHelpers::Gauges
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 YamlHelpers::Gauges

#dial, #dials, #gauge

Methods included from YamlHelpers::Base

#clazz, #indent

Methods included from HtmlHelpers::Gauges

#_ziya_gauge, #class_id, #codebase, #default_gauge_options, #gauge_path, #gauges_swf, #ziya_gauge

Methods included from HtmlHelpers::Base

#escape_chars, #escape_once, #escape_url, #mime, #plugin_url, #setup_movie_size, #setup_wmode, #tag_options, #ziya_tag

Constructor Details

#initialize(license, design_id) ⇒ Base

Returns a new instance of Base.



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ziya/gauges/base.rb', line 14

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.debug( ">>> 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.



11
12
13
# File 'lib/ziya/gauges/base.rb', line 11

def components
  @components
end

#design_idObject

Returns the value of attribute design_id.



10
11
12
# File 'lib/ziya/gauges/base.rb', line 10

def design_id
  @design_id
end

#licenseObject

Returns the value of attribute license.



10
11
12
# File 'lib/ziya/gauges/base.rb', line 10

def license
  @license
end

#optionsObject (readonly)

Returns the value of attribute options.



12
13
14
# File 'lib/ziya/gauges/base.rb', line 12

def options
  @options
end

#typeObject (readonly)

Returns the value of attribute type.



11
12
13
# File 'lib/ziya/gauges/base.rb', line 11

def type
  @type
end

Instance Method Details

#set_preferences(opts = {}) ⇒ Object


provides for overiding basic functionality

gauge_color

Legend color

legend_color

Gauge color



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

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

#to_xmlObject


render gauge to xml



37
38
39
# File 'lib/ziya/gauges/base.rb', line 37

def to_xml
  render_xml
end